Hi.
I need some help learning to think 3D. I’ve coded 2D games for a while, but finally took the step to try to learn this third dimension. I am used to thinking in definite widths, heights, x’s and y’s. I’ve started tampering with JOGL, and although I usually manage to try/fail until I get somewhat of the look I want, I feel I do not really understand why some things work, why some do not, and why things look like they do.
There seems to be so many things that affect what actually pops up on my screen, and where it pops up. I’ll give an example.
gl.glVertex3f( 1.0f, 1.0f,-1,0f);
From what I gather, 1.0f here is somewhat of a size ratio. 0.0f is the center. (relative to translation). Lets say I have a texture that is 64*64 pixels. When is (-1.0 …1.0f) in the previous line 64 pixels?
I use negative z translation (otherwise naturally, part of what I draw is drawn outside of my scope). I also use gluPerspective in my resize event. I read that you can interpret gluPerspective’s first parameter as a camera lense, (…180mm so to speak). However, I dont know when it is “flat”, in lack of a better word…
Now I dont understand how gluPerspective works in detail on a whole, either.
I guess I would just like to be able to foresee how big, and where, my sprites would be positioned on the screen before I run the program. (This comes so naturally in 2D that I have a difficult time adjusting my line of thinking).
Any advice is appreciated. If you link to articles, that is fine, - but if you try to explain it with your own words, it would be much appreciated.
Thanks.