OpenGL vs.(?) Java3D

I have a few questions about using OpenGL with Java.

  1. If you utilize the Java3D api doesn’t it, in turn, utilize the
    underlying OpenGL implementation of the operating system?

  2. Is Java3D just an OO wrapper for native OpenGL calls?

  3. What’s the real scoop? Do people use GL4Java or the Java3D api?

thanks all.

1 - If you have the OpenGL version of Java3D then yes.

2 - No. Java3D is a higher level of abstraction.

3 - Truth be told neither is used that much. Java3D is still new and uses massive amounts of memory for simple scenes. I like GL4Java and Magician. But you will be programming for a limited audiance.

thanks for the reply gkw,

i’m just learning java and need something
compelling to keep it interesting. i also
want to help support opengl (vs. direct3d).

now all i need to figure out is if i have
java3d on my system (hmm… does it come
with jdk1.3?) and, if i do, if it’s the
OpenGL version.

if anyone wants to offer further info, i’ve
got mandrake7.2 linux and the jdk1.3 installed.

thanks again.

Java3D is something that you need to download from Sun. Sun doesn’t like to bloat the basic jre so more people will use it. Unless you have a kickass workstation I would suggest using GL4Java or Magician. The memory consumption is far less than Java3D, and you will actually learn OpenGL. If you want to use magician you can take a look at my site, operecitato.freeservers.com.

thanks again groundskeeper,

i clicked around your site and followed the link to
magician.

i’m in.

A good reason to keep learning Java is network stuff - it is far easier than the Windows equivalent.

A good reason (IMHO) is not 3D programming, either OpenGL or peseudo-OpenGL. Stick to C for that - you’ll get far better performance, and be able to reach a broader audience (as noted above).

There are people out there making 3D tile based games. You just cannot make a fps with Java. The way the event queue is set up means any fps is going to run very slow. But any 3D game that is not dependant on high framerates will work just fine. There are several other non-graphics related problems that come into play with a fps that Java would not handle well. But you definately could make a Civilization type multiplayer game in 3D. You may even be able to do an rts.

just thought i should add a few comments.
i haven’t really used Magician that much, just downloaded it and wrote a few test applications. i didn’t like it, mostly because it’s not a direct wrapper around OGL.
i liked GL4Java better, it’s almost a direct wrapper (or interface, or whatever you want to call it) and is quite easy to get into.

after playing around for about two weeks in Java with OpenGL, i decided there HAD to be a memory leak SOMEWHERE, since after testrunning my apps about 50 times i had almost no free memory, and i never seemed to get that allocated memory back until i rebooted.
as we all know, Java has automatic GC (which is one of the reasons it might not yet be such a good idea to write an FPS engine in it, but also one of the reasons it’s so nice), so i knew my Java code wasn’t the problem.
GL4Java however, use native C code to call OpenGL etc. so i downloaded the source and took a look at it.

****. it’s fugly. it’s in dire need of some serious clean up. the best thing would probably be if it was rewritten. i would personally think twice before using it in a “serious” product.

still, Java is a damn fine language for testing new algorithms. it may not be a good idea to write your engine in it, but if you just want to try a new shadow algorithm, a new subdivision surface or whatever, Java is great.

just my two cents.

I have not used gl4java in a while but there are known memory leaks in the last couple jre’s. I think there is a slight memory leak in magician, 8-12k, but it is hard to tell since it may be the jre. I don’t know what you mean about magician not being a wrapper. It has every gl call that I can do in c. Besides the guy who wrote it has been using Java since it was Oak. I figure he might know a little something.

thanks all for the great comments.

i was impressed by the magician site
http://arcana.symbolstone.org/products/magician/index.html

since i’m interested in using it while learning java
and also to draw "pretty pictures"™ i think it’ll
suit me just fine. i’ve already got a little ogl
experience so i should be golden.

This may be a bit of topic, but has anyone been able to install GL4Java properly. I tried a few times and it was a huge pain in the neck. I don’t like that whole installing over the net thing.