Allright, first; How do I convert my mouse coordinates (i.e x = 400 & y = 300) to gl float coordinates (i.e x = 0.0f & y = 0.0f).
Second; I’ve compiled a few objects, let me use a simple cube (2f * 2f * 2f) for this example. It’s drawn centered at 0f, 0f, 0f (seemed locigal), and compiled into a glList. Now, when I want to draw this cube, I do like this;
gl.glLoadIdentity();
gl.glTranslatef( /* whatever x, y and z coordinates I’d like to use */ );
gl.glCallList(CUBE); //Integer containing memory slot for this particular item
Okay, this works fine. I also tried to rotate the cube a little around it’s own axis. Also worked fine. Now; here’s my problem:
What shall I do in order to rotate this cube around an axis far away from the centre of the cube? Like, the cube is drawn at 2f,2f,-10f, and I want to rotate it around an axis at 0f,0f,-10f.
You get what I mean?