Presumably, for what reason do you think your camera is moving, not your model, because all the objects in the scene are moving together?
After rendering your model and before rendering other objects, will you reset the MODELVIEW matrix? In other words, do you execute other glLoadIdentity () or glPopMatrix () after you say the model you are talking about and before rendering other objects?
, , , , , , ( ).
, :
glTranslatef(0.0f, 0, -zoom);
glRotatef(yr*20+moveYr*20, 0.0f, 1.0f, 0.0f);
glRotatef(zr*20+moveZr*20, 1.0f, 0.0f, 0.0f);
//Here model render :/
(0, 0, -zoom)?
, (x, y, z), :
- (x, y, z) (0,0,0), (-x, -y, -z)
- (x, y, z), (x, y, z)
- Draw
(0,0, ), 3.
, :
glTranslatef(0.0f, 0, zoom); // translate back from origin
, (0,0,0), z, , , @nonVirtual .
reset MODELVIEW, . , :
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
#if you want to rotate around (0, 0, -zoom):
glTranslatef(0.0f, 0, -zoom);
glRotatef(yr*20+moveYr*20, 0.0f, 1.0f, 0.0f);
glRotatef(zr*20+moveZr*20, 1.0f, 0.0f, 0.0f);
glTranslatef(0.0f, 0, zoom);
#else if you want to rotate around (0, 0, 0):
glRotatef(yr*20+moveYr*20, 0.0f, 1.0f, 0.0f);
glRotatef(zr*20+moveZr*20, 1.0f, 0.0f, 0.0f);
glTranslatef(0.0f, 0, -zoom);
#endif
glLoadIdentity();