Skip to main content
GameDev.net gamedev.net
🔒 Locked

Having trouble with Camera

Started by Paddeh Oct 5, 2001 at 11:03 AM 0 replies 350+ views
Original Post
Paddeh
Paddeh
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
Obelix
Obelix
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.