I'de recommend to start play around with processing first, there's ton of stuff you can do without having to start screwing with native opengl commands. Processing can do almost anything natice gl can do, it's just somewhat slower. On the flip side you don't have to worry about surface normals lighting calculations, vertex arrays etc. Most of the sketches i've made started as pure processing and then i optimized them with native opnegl commands. Once you get comfortable with coding then buy a book on opengl, i'de recommend the opengl super bible 4th edition. I spent two months reading books on processing and java before i started screwing with native opengl. and if you haven't already done so pick up one of the processing books they're great reads.
if you still want to jump right into native gl. here's some info on getting you started:
Quote:
import processing.opengl.*;
import javax.media.opengl.*; // This is the jogl library you need
PGraphicsOpenGL pgl; // bindings for opengl
GL gl;
void setup(){
size(600,600,OPENGL);
hint( ENABLE_OPENGL_4X_SMOOTH); // anti aliasing
pgl = (PGraphicsOpenGL) g;
gl = pgl.gl;
}
void draw(){
background(0);
// processing code goes here
pgl.beginGL(); // place before you native gl code
// gl code does here
// this translates the different matrices and other stuff so that
// you can use gl commands note that most of the processing commands will
// not work or will behave strangly so don't mix the two. Gl geometry
// will only be lit with gl lights and normals.
pgl.endGL(); //place after your native gl code, you can place more processing stuff here
}
This is pretty much what you'll need to interface processing with opengl. if you need some tutorials look for tutorials on jogl (java opengl): here's a couple of links:
jogl forums:
http://www.javagaming.org/forums/index.php?board=25.0
a couple of tuts:
http://www.felixgers.de/teaching/jogl/index.html
Don't worry about setting up a jogl environment or window creation etc... processing does that for you, that's the beauty of it.