Recommended Posts

hi
I am using a camera very similiar to that from ultimategameprogramming and i am trying to attach a 3ds model to the camera(a weapon) ...i can load the mesh into my scene no troubles,when i render the mesh i try to do this
glTranslatef(camera.view.x,camera.view.y,camera.view.z);
this places the mesh so far away i can hardly see it.
i tried
glTranslatef(camera.pos.x,camera.pos.y,camera.pos.z);
but obviouslly this way the mesh will not rotate when the camera does.
anyone got any pointers for me?
Thanks

Share this post

Link to post

Share on other sites

Eh... glLoadIdentity() is an almost no cost function. Chances are something else you were doing was wrong.

EDIT: i was typing one handed so i didnt care to finish my thought. glLoadIdentity() either sends 16 floats over the bus, or simply sends a message over that says change the current matrix to identity. Both of these would take up relatively no time whatsoever.