tags:

views:

493

answers:

5

I'm interested in learning OpenGL and my favorite language at the time is Java. Can I reap its full (or most) benefits using things like JOGL or should I instead focus on getting stronger C++ skills?

Btw, which is your Java OpenGL wrapper library of choice and why?

+7  A: 

JOGL is a wrapper library that allows OpenGL to be used in the Java programming language. It is currently the reference implementation for JSR-231 (Java Bindings for OpenGL) so it should be your first choice

dfa
A: 

Do it in C++, the bits you'll be using will basically be the same, because there won't be much messing about with pointers, so it's not a major leap of intuition. Also, the C++ bindings are more reliable and (in my experience) the fastest out of all the langauges available (Python in particular REALLY can't do OpenGL).

Also, C++ is always a good thing to learn, it makes you think about programming concepts in much more detail, as opposed to just popping in an ArrayList<> or whatever pre-built class kind-of-serves your purposes =]

Ed Woodcock
+1  A: 

If you are also interested in just doing 3D stuff in Java without worrying about all that low-level stuff, check out Java3D.

Worst case, you can look at how they leverage OpenGL for some good learning material.

Erich Mirabal
+1  A: 

if you really want to get serious at 3d programming you have to learn C/C++, C++ is the standard for programming 3d games

hiena
Games aren't the only commercial application of 3d graphics, there's plenty of other things, kitchen design software for example?
Ed Woodcock
+2  A: 

I have done some basic OpenGL development in Delphi and Java as well. I used JOGL, as mentioned in others' replies, and I must conclude that although there is very little difference in programming OpenGL in Java using JOGL and programming OpenGL in other languages (Delphi, C++, etc...) it just doesn't feel right. It was driving me crazy to set it all up correctly and then writing stuff like

gl.glBegin (GL.GL_QUADS)

there seems to be a lot of superfuous gl, GL, GLU to be written and it just gets in your way. Also the performance would be, I believe, much better if you used C++ or similar, NOT Java.

I am not saying hands off JOGL (Java+OpenGL), it can be done, and it really isn't too different, but... as I said. Give c++ a try, if you can.

Peter Perháč
imho gl, GL, GLU is not superfluous since they allow to direct translate in Java their C code or tutorial
dfa
I mean, I prefer calling glBegin(GL_QUADS) instead of gl.glBegin(GL.GL_QUADS) :)
Peter Perháč
then use "import static" :-)
LordOfThePigs
I partially agree. The "gl" prefix on the method names is not necessary.
finnw