Sorry about all the questions. I have (attempted) research on all OpenGL related topics and this is one (very basic I assume) principle that I just don't seem to get.
How does Translate work? When placed inside a PushMatrix/PopMatrix and before the drawing of an object, I assume it would translate it by the specified 3D coordinates. ie, translatef(0.0, 0.0, 1.0f) would move the object 1 unit away from the camera. From the tutorials, I can tell that I'm clearly wrong about the z. When I try it myself, it moves the object down by 1 unit.
Someone, please correct me and my mistake. How does translate REALLY work (I'd prefer if you don't go until matrices unless that's the only way to explain). And how would you move the object 1 unit away like I intended?
Again, thanks for any and all help I recieve.
[Edited by - Caglow on April 5, 2009 8:30:07 PM]
your understanding of translatef should be correct, you just didn't notice that we're having a right handed coordinate system where +X goes to the right, +Y to the top and +Z towards the camera, so just pass -1.0 to glTranslatef and you should get the expected result.
I'm not sure what it's exactly doing here...it's either moving the camera around the object or it's moving the light source.
EDIT: From what I just realized...I think translating an object closer or farther doesn't change its size. How would I go about "linking" the translate with a size change? It feels very obvious but I can't figure it out.
well according to your code it does move towards the screen, the only problem is that it moves "behind" the camera, and it can do this because i think you have an orthographic projection matrix and not a perspective one as one normally uses. thus no matter how it moves along the z the size won't change.