Colleagues of mine are using Java3D for visualizing results of finite element simulations. The problem is that Java3D seems to be somehow dead, and it is a pain on OSX. This is one of the reasons we are looking for alternatives.
Quite a lot of work has gone into our current implementation based on Java3D, so the question is how much effort it would be to move away from Java3D.
JOGL is one option, but looks like a lot of work.
Has anyone suggestions for alternatives? Any experiences with such a migration?
JOGL provides a direct access to OpenGL functions. These functions are mostly low level draw functions, and you have to deal with the 'state machine' nature of OpenGL while you are programming.
Java3D abstracts this state machine. It allows you to define a tree of graphic objects, placed in a virtual scene, and rendered by a camera. The manipulation of these graphic objects is easier with such a tree structure. Then, it's up to Java3D to walk through this tree and call the OpenGL drawing functions.
This kind of library is called a scenegraph. There are many scenegraph libraries in java, some are implemented on top of JOGL. I don't have a list, but this keyword will help you in your research.
In our project, we tried 3 or 4 different libraries, but no one filled all our requirements. We ended writing our own scenegraph library (on top of JOGL).
jMonkeyEngine, Ardor3D, jPCT or Xith3D are much better options these days.
JOGL is indeed a good option. However, it's simply a wrapper library for OpenGL. That means you'll still have to do a lot of the legwork yourself. If you're comfortable with that and it suits your needs, it's not actually all that difficult. But it might be a bit time consuming and not knowing your current code-base I don't know how easy the transfer is.
You could however go for an engine which might use JOGL. Something like JMonkey Engine to purely name an example. If you look, you'll surely find some others. Have a look at those, their ease of use and their functionality to see what best suits you. They probably won't take all the work away from you, but they might make it a bit easier.
See also this Java 3D forum thread : Java3D viability questions... https://forums.oracle.com/forums/thread.jspa?threadID=2150209&tstart=15
August, InteractiveMesh
I use JOGL 2.0 (which is a low level Java binding for the OpenGL (and OpenGL-ES) API. I have recently helped someone to revive Java3D. Now, it relies only on JOGL 2.0 and it works better, especially on Mac OS X. You can find the source code here:
https://github.com/hharrison/java3d-core
Let's have fun. It is actively maintained anew ;)
P.S: I wrote a detailed article to explain how to use the very latest version of Java3D (1.6) here.
Related
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... :)
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.
just joined this awesome siteā¦
Ive recently been working in XNA on C#, making a library for that framework.
Ive gotten interested in java at was going to try making a similar library for java.
Thats when the problem arrived, there doesnt seem to be a standard 3d renderer on it.
Ive heard of JOGL, but it seemed to be discontinued (project inactive), and i prefet high level anyway,
Then I saw jMonkey and espresso 3D, but both seemed less efficient and less pretty then directx.
JavaFX discouraged me by saying that its for rich internet content.
My question is, which out of these are optimal. What is the technical difference between OpenGL and DirectX, are jMonkey and co. Actuallh effective? And if not is there a framework similar to XNA for java?
I only ask you name some and point me in the right direction, as this got me a bit confused after the 1 way .NET xD.
Also, as this is my first post here, feel free to correct any mistaked I may have made.
I think jmonkeyengine or jogl are probably the best choices, but it really depends on what your doing. Jogl looks like its still going but is now part of a fuller set of libraries, jogamp, which covers sound and gpgpu programming as well as graphics.
http://jogamp.org/
Jogl is essentially a java wrapper around OpenGL, so will be low level and require to write shader code in order to do anything modern. Jmonkeyengine is probably more the sort of thing you're after since it comes with a lot of prepackaged functionality (including its own IDE).
The real standard 3D API for Java -- in the sense that it's the one that Sun once considered "official" -- is Java3D, which is a scene graph API, something like Open Inventor. I never liked it much, and the level of support these days is pretty low. But it's worth considering, if only for completeness.
I'm looking for a good (hopefully free) 2d graphical library in C++, or in worst case, Java, which helps create the look and feel of Flash animations, the typical ones you can find in most flash games.
The best would be if it provided most of the features and easiness of Flash animation programming, like layers, or even collision detection, etc., without all the micromanagement of pixels typical for opengl. Of course, it can be built upon opengl...
Edit: interactivity is important, it might not been clear in the first description. So I'm not aiming just for an animation, or presentation. A good collision, gravity, etc. system is very much welcome, as are good GUI widgets.
Checkout the new ForPlay from Google.
It compiles to java, javascript, android and more.
Edit: Moved and name changed to PlayN
There is also a stackoverflow tag
Potential ideas:
Processing has been used to make some very good visualizations.... depending on what you want to do this may be a good option.
JavaFX was designed as a framework for building Rich Internet Applications (a bit like Flash). I think it has a lot of the Flash-like features you are referring to.
I don't know if this is exactly what you're looking for, but you can take a look at SFML.
As we know that we can use NetBeans for creating Swing programs (with drag and drop the code for each part of Swing will be written automatically)
Is there any software that help us write Java 3d code without writing code manually?
I don't think there's anything out there like that for almost any languages. The problem is... what exactly are you creating? With swing you know you are making a GUI for a certain set of applications but with 3D, the applications are endless. The only thing out there are APIs to help with your job. If you are an animator or game maker there are plenty of game engines to help you out.
Widening your question slightly if what you're looking for is a more productive 3D java environment (rather than Java 3D itself) then Demicron's WireFusion is worth a look. It's Java based and the higher-end versions allow pretty comprehensive access to the underlying engine so you can effectively extend it to do nearly anything.
I've used it for a project or two and I highly recommend it, the only issue is it's ridiculously expensive - in fact jaw-drop'ingly so.