• Advertisement

Archived

This topic is now archived and is closed to further replies.

Having trouble with Camera

This topic is 5954 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all, just started getting into Opengl and am having trouble understanding translatef.. at first i thought it controlled the actual view, but it actually controls where things are positioned (i think?!). Anyway, my question is this, I have a skeleton opengl window, and a spinning cube, the code i use is basic, and i have added this to my DrawCube(); function glTranslatef(0.0f,0.0f,z); glTranslatef(0.0f,0.0f, forward); I made it so that the keyboard ''a'' and ''z'' would decrease and increase the forward variable, to move the object back and forth. If i wanted to draw a large cube around the small one (a square room for example) would the translatef lines make both objects move backwards and forwards? or just the one that the function is in? I hope i''ve made this clear enough, if not i will try and make it easier to understand Also, I''ve tried to make a floor to my scene, but I cannot seem to get it to position right, it either positions as if stuck to the bottom of the cube, and it rotates with the cube, or it just doesnt seem to render atall. any ideas what im missing ?? Thanks for your time, hope someone can help

Share this post


Link to post
Share on other sites
Advertisement
OpenGL is immediate updating the buffer with the current settings. Something like
- get data for one object and update
- get data for another object and update
So if you do change the translation between the objects would they share it.

OpenGL is a state machine with a lot of settings that is the same until you change them.

Share this post


Link to post
Share on other sites

  • Advertisement