JOGL vs JAVA3D question

I’m moving from C/C++ to Java for a game programming project and I’m having a very hard time deciding on which Java/OGL binding to use. I read Jeff’s most interesting FAQ and ran across this jewel:

[quote]Although it doesn’t come up as much in games, it is also worth noting that Java3D can only render in “heavyweight” mode using AWT. That means that if you try to put a “lightweight” Swing component on top of the 3D, it won’t work-- the 3D scene will overwrite the pixels. JOGL supports lightweight mode, so any scenegraph based on it should support lightweight or be easy to modify to do so. If you want a 3D scene in a “window” inside your game, perhaps for a multi-pane adventure game, Java3D is probably not for you.
[/quote]
This is an important item to me as I wish to render different “real time” camera views in an “instrument console”. For instance, a targeting camera. So, if I’m reading this correctly, to achieve the effect I want, JAVA3D is definately out of the picture and I’ll need to use JOGL and a scenegraph that support it?

Very noobish Q, but hey, gotta ask questions. Thx.

  1. It depends on what you’re doing. If you’re creating a full-up action game, using Swing is not the way to go. You usually want to create your own in-game widgets to handle user events. Both APIs should be able to give you sub-views (a la Bridge Commander) without resorting to lightweight rendering.

  2. Java3D is a scenegraph. That means that it allows you to create a model of what your 3D world will look like, then it will try to render that model as fast as possible. JOGL is a direct OpenGL mapping. That means that you can send commands to render polygons, but all the hard work inherent in depth sorting and world management has to be done by you and you alone.

The choice between using an existing scenegraph and your own custom engine is a decision that requires a great deal of thought and planning. The scenegraph makes things easy and will render most environments (including Quake-like environments) without too much difficulty. A custom engine, OTOH, will only be as good as you are. If you have complex requirements (for example, meshes that morph into more detail as you get closer) then a custom engine can provide. If you’re just going to reimplement a standard scenegraph badly, then you’re wasting your time.

Just to make your life more difficult, other Scenegraphs that are more focused on gaming include:

Xith3D - A scenegraph that attempts to be somewhat compatible with Java3D, but more gaming focused.
jMonkeyEngine - A scenegraph that is focused on being a feature-rich option for gaming.

Try lurking in the 3D forums here for more info. :slight_smile:

I wouldnt say that, but i guess its not the easiest or quickest way to go about things.