2d Multimedia Library on the JVM - java

I'm searching for a rich 2d multimedia framework that's meant to be used with the JVM
There's SDL and SFML for C and C++.
I've used Pygame with Python. It's very productive.
XNA is great, too.
What about the JVM ? I know that there's a wrapper around SDL http://sdljava.sourceforge.net/ but since the last entry on the homepages newsfeed dates back to 2005 it doesn't feel particularly alive.
Basically what I'm looking for is a hardware accelerated 2d canvas for the JVM that is backed with a neat framework.
I know that C, C++ and even Python (to some extent) can be considered low-level languages. Java on the other hand abstracts over the hardware. Therefore what I'm searching for is not it's "natural territory". Nevertheless http://lwjgl.org/ is a great example of what is possible in Java.
Googling brought up this interesting project http://libgdx.badlogicgames.com/ . Have you used it ? Do you know alternatives ? Please note: I'd like to use Scala, not Java. Therefore the stress on JVM and not just Java.

Have you already looked at JavaFX 2.0?
Rendering engine is based on prism, which supports hardware and software rendering (this means it will use either DirectX or OpenGL or Java 2D depending on what's available). You can find more information about it's architecture here:
JavaFX Architecture and Framework
It uses Scene Graph in order to define things you want to render. Here you can find small introduction:
Working with the JavaFX Scene Graph
Scalafx project provides Scala bindings for JavaFX 2.0.

If you want something that works use http://lwjgl.org/ from scala.

Related

Are Unity's "MonoBehaviour Components" equivalent to systems from the Entity-Component-System design pattern?

I am working on making a very simple 2D game engine, and I am in the process of redoing my entities to work somewhat like Unity's system. I have been doing research on how the Entity-Component-System design pattern (ECS) works, and I am beginning to understand it better.
As I understand, a component in ECS only holds data and is not capable of doing anything but retain that data. These components are then used by systems which are used to read and manipulate their data.
This led me to question is if the MonoBehaviour scripts that are attached to a GameObject in Unity are technically systems and not components as they are called in the Unity editor?
If I am mistaken, I think it would be helpful for me to analyze true implementations of ECS. I am coding in Java, so if anyone has any examples of an ECS system implemented in Java or C#, that would be great as most of the examples I have seen were in C++ which is a bit more difficult for me to understand.
Thanks!
Unity doesn't strictly work via an ECS, despite using the term "Component." A Unity component, in the form of a MonoBehaviour, can have both data and system logic. Unity will, in future versions, be rolling out an ECS model.
If you'd like to use current Unity versions (2018.1 and below) and strictly adhere to an ECS methodology, I'd suggest looking into Entitas and their Unity Plugin. You can also choose to structure your code, assets, and scenes to conform to ECS principles but Entitas is very efficient and solves a lot of problems for you.
the mono system in unity can be called EC(entity-component) which is base on Object-oriented design.
the ECS(entity-component-system) is base on Data-oriented design.
there is both data and logic in a mono component.

DICOM 3d display - Java 3D vs VTK

I'm going to work on implementing 3d display of dicom files and I'm wondering which technologies is easier to use: Java 3D or VTK?
I'm not very experienced programmer,but I've already created a DICOM viewer based on dcm4che open source library.
Any hints or experiences to share?
Most of my 3D modeling is Optical Coherence Tomography data that tends to be rather large. My experience has been a little backwards. The project started as a C++ project using x64 VTK and Qt. Folks in the lab weren't C++ people, so it got converted to Java which is used through Matlab, which the lab post-docs know.
Java VTK is really easy to use and has a lot of features, but I'm having some trouble with registering callback events for buttons and such with will be a deal breaker if it can't get resolved. This problem might dramatically effect how the UI is done, so keep that in mind.
Most of the C++ examples tend to convert to Java really quickly (except callbacks >.< ) so there is a plethora of examples. If you are going to use VTK, I highly recommend "The VTK User's Guide" by Kitware, Inc (ISBN: 978-1-930934-23-8), as it is an excellent overview of the API.
Good luck!

GLUT alternative in Java & Android?

I noticed that GLUT is only available for C++. I am looking to reuse my OpenGL code on Java, then again port it to Android. Is there anything that is the 'standard' used instead of GLUT for these systems?
Edit:
I am in fact using JOGL and interested in reimplementing via Java and not reusing C++. I have a basic understanding of C++, Java, and OpenGL, but nothing fancy yet. I'm fine with trying to figure out everything about windows like resizing, coloring, etc. I'm wondering if there's anything to help me with some of the (more advanced?) functions like glutSwapBuffers(), glutDisplayFunc(), glutMainLoop(), etc.
What about JOGL or LWJGL .Their APIs are 1:1 to C++ glut.If you use the fixed pipeline you also have Glu lib with all you need inside.I didn't work with JOGL seriously because I didn't like the way it manages contexts and windows but I did do commercial projects with LWJGL and can tell this lib is fantastic.Also you can use it for mobile development.
I want to extend on this topic a little bit:
First , it seems like JOGL has got GLUT class which takes care mostly of primitives creation.Also I found this lib which is a partial port of C++ GLUT.But in fact , I don't understand your reason behind seeking GLUT C++ like lib.JOGL and LWJGL both supply you with input handling , context and window creation which are built in features.And in Java you will not probably be able to Unify context and windows creation under single roof because Android and Windows Java environments do it differently.Of course you can always roll your own class which will underneath take care of context/windows setup based on the platform but I think it is like re-inventing the wheel.
Regarding primitive geometry creation- I wouldn't bother to look into GLUT in such a case.Those are made using old ,deprecated (fixed) OpenGL pipeline.Today is 2013 and OpenGL is currently on 4.3 version and if you want to be synchronized with the current state of this technology and benefit from many new capabilities in OpenGL ,I would strongly recommend moving forward to OpenGL 3.3 onward.Doing this you need to code geometry manually.But there are many other benefits you gain like a total control over the way your rendering pipeline works.Also there are many online examples and tutorials on how create geometry for the programmable OpenGL.
Hope it helps.
There is jnigraphics and use NDK to develop the native C code for Android.
GLUT support is very limited in jogl, it definitely has no glutInitDisplayMode(). I suggest you to do the following:
Simple way.
Figure out what is minimal set of glut functions you need;
Create a small dynamic library calling them for you;
Bridj that library and call the methods you need from your java app.
More complex way.
Add needed functionality to jogl+gluegen, they have kind of code generator for that.
This way is imho more correct but:
(a) This is more work;
(b) jogl maintainers are not so friendly unfortunately, you will not be able to easily share work with community. First they will start blame you that your patch is piece of shit. Later they will almost command you to do in a way they need. In other words, it will take month for stupid emails... :)

Plotting dense 3D point clouds ( or mesh) in java

I am gonna be writing java code to plot 3D point clouds. Someone suggested me to go for java 3D libraries however it is apparently dead (this reference) and not apparently good idea go to with JMonkey either (same reference).
That link was posted in 2009 and we are in 2012.
All I want to do is to plot a dense 3D point cloud, say 5 million points, and to be able to rotate it / or zoom in real-time. I know the algorithms for rendering and stuff however I need a set of 3D java library with active community and support ( if any).
Please consider Desktop and also Web applications while suggesting me the solution.
Thanks a lot
and not apparently good idea go to with JMonkey either (same reference)
What you reference there is more than three years old, ancient in terms of technology.
jME has come back in a big way since then. jME3 is it an extraordinarily stable beta with Android support, improved physics support (both JBullet as well as a native wrapper), an SDK with scene editor, lots of user-contributed plugins, and an extremely active community.
There are a number of successful games making use of it as well, most notably Mythruna and 3079.
What you're looking to do is easily accomplished in jME and we'd invite you to come on over and try it out. http://jmonkeyengine.org
Not a scenegraph, but LWJGL offers an easy wrapper around OpenGL, so you could quite easily construct a list of quads to represent your points and setup/modify a view to display and rotate them depending on user input.
This should work in applets also to cover your web targets.
jzy3d
is what you are looking for.
Jzy3d is an open source (BSD) java library that allows a rapid display
of 3d scientific data, either surfaces, scatter plots, bar charts, and
lot of other 3d primitives. The API provides support for rich
interactive charts, with colorbars, tooltips and overlays. Axis and
chart layout can be fully customized and enhanced.
I would use JavaFX for this. It is already included in JDK 8 and the project is well alive.
Contrary to LWJGL, there is more and better documentation. Also LWJGL being a thin wrapper, will force you to learn OpenGL as soon as you need to do any transformation, and that will take you some time.
Jzy3d is a higher level API but the tutorial is not free.
JME3 is overkill and, as long as my limited experience with it taught me, you'll need to use Blender to create the model (I might be wrong).
There is a lot of documentation for JavaFX online. If you don't mind buying a book, "JavaFX for Dummies" is quite good, although basic.

HPC (mainly on Java)

I'm looking for some way of using the number-crunching ability of a GPU (with Java perhaps?) in addition to using the multiple cores that the target machine has. I will be working on implementing (at present) the A* Algorithm but in the future I hope to replace it with a Genetic Algorithm of sorts. I've looked at Project Fortress but as I'm building my GUI in JavaFX, I'd prefer not to stray too far from a JVM.
Of course, should no feasible solution be available, I will migrate to the easiest solution to implement.
If you're interested in HPC with GPUs then perhaps you can look jCuda. This provides Java bindings for CUDA, along with access to CUDA FFT, CUDA BLAS and CUDA DPP. I haven't seen any performance reports on this library so I can't guarantee it will be very good.
Beyond that, I'm not really sure. If you're interested in doing this type of stuff as an educational exercise then Java should be good enough, but if you have a serious need for HPC then you're probably going to want to implement in C and use the Java Native Interface to communicate with it.
Morten Nobel Joergensen has a blog post showing how to create a Mandelbrot Set using JOGL - Java Bindings for OpenGL
However if you want generic computing, rather than graphics, then you'd be after the Java bindings for OpenCL, from which you can chose from JOCL, or JOCL or JavaCL.
Wikipedia's page shows how OpenCL can be used to compute a fast fourier transform.
Parallel Colt might be of interest.
Have a look at JPPF, it is a very nice and mature open source Java grid computing environment

Categories

Resources