View Full Version : glTranslate
01-29-2006, 09:23 AM
Hi all its a simple question really,
I want to know if there is any way to translate a static object to the screen so that it doesnt move when I move.
Does anybody know how to do this or have some sample code I could look at?
Cheers in Advance
01-30-2006, 03:16 AM
can you say a little more about your question ?
01-30-2006, 03:53 AM
sure no problem I have a scene in opengl your basic cube stored in a display list.
when I add objects to the scene using gltranslate to move them into the position on the screen that I want them, I have problems when you move around the screen the model isn't static.
I was wondering if there was another way to do it apart from using glTransferf(x,y,z);
here is some of the code I have written:
gltranslated(x,y,z); // move into the scene
glCallList(ROOM); // this is the cube you can move around in
glTranslated(x,y,z); // move model into the scene
01-30-2006, 05:23 AM
Notice that glMatrixModel(GL_MODELVIEW) is called first and glLoadIdentity() is called as second.
And the last glMatrixModel(GL_MODELVIEW) is removed.
01-30-2006, 11:42 AM
:( that didnt work either. This is head wrecking. Anybody wanna take a look at the exe and the code to see if they can fix this for me? or suggest what Im doing wrong?
let me know and I will email it to you to take a look at?
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.