I'm experimenting with the MD2 Animation tutorial from www.gametutorials.com and have this object called g_3DModel, any idea how to rotate it, move it, etc?
This is a discussion on Rotating In OpenGL within the Game Programming forums, part of the General Programming Boards category; I'm experimenting with the MD2 Animation tutorial from www.gametutorials.com and have this object called g_3DModel, any idea how to rotate ...
I'm experimenting with the MD2 Animation tutorial from www.gametutorials.com and have this object called g_3DModel, any idea how to rotate it, move it, etc?
0100001
glRotate*() and glTranslate*() functions modify the location of objects in the world relative to a stationary camera. So instead of moving the actual camera around the world, it will move the world around the camera. If you wanted this same effect but on the camera you would use the gluLookAt() function. The following code is an example from my book to help explain this more:
When u picture this in use, imagine being in the piolet seat.Code:void PlaneView(GLfloat planeX, glfloat planeT, GLfloat planeZ, GLfloat roll, GLfloat pitch, GLfloat yaw) { //roll is rotation on the z axis glRotatef(roll, 0.0f, 0.0f, 1.0f); //yaw (heading) is y rotation glRotatef(yaw, 0.0f, 1.0f, 0.0f); //pitch is rotation on x glRotatef(pitch, 1.0f, 0.0f, 0.0f); //move the plane to the planes world coordinates glTranslatef(-planeX, -planeY, -planeZ); }