First if you have some kind of structure to your program, it will make it easy to follow later on. As understand that openGL works in reverse of how one would think rotation and translation should effect an object.
keyboard();// we do keyboard stuff here.
if (key == up_arrow) z++;
display();// we draw things here!
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity(); // Start with a clean matrix… note I am not sure why you call it more then once in your program… maybe part of your problem.
glMatrixMode(GL_MODELVIEW); We are ready to draw.
// Move our view, replaces glulookat
glRotatef(WrotateX, 1.0f, 0.0f, 0.0f); // look right/left
glRotatef(WrotateY, 0.0f, 1.0f, 0.0f); // look up/down
glRotatef(WrotateZ, 0.0f, 0.0f, 1.0f); // rotate view, may need to use.
glTranslatef( 0,0, Worldz); // move on the z-axis
// now draw objects
glPushMatrix(); // save the matrix, we only want to effect this object with the follow commands.
glTranslate(…);// move object to its location.
glRotate(…);// rotate object
glPopMatrix(); // repeat this code for each object you want to draw.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
gluLookAt(0.0f, 1.0f, -1.0f, 0.0f, 1.0f, 6.0f, 0.0f, 1.0f, 0.0f);
glTranslatef(-0.8f, 0.0f, 2.0f);
glRotatef(turnrot, 0.0f, 1.0f, 0.0f);
glScalef(0.1f, 0.1f, 0.1f);
glTranslatef(0.0f, -1.4f, z);
i didnt understand that tut… it is hard to understand without any code… thanks anyway…[/b]<HR></BLOCKQUOTE>
[This message has been edited by nexusone (edited 08-28-2002).]