Void the display ()
{
GlClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
GlMatrixMode (GL_MODELVIEW);
GlLoadIdentity ();
//glTranslated (0.0, 0.0, 0.25);//gavab face information display
GlTranslated (0.0, 0.0, 3);
GlMultMatrixd (pModelViewMatrix);
GlColorMaterial (GL_FRONT GL_AMBIENT_AND_DIFFUSE);//set the color to track the material properties, and the face of the polygon
If (pModel)
{
GlColor3f (0.3, 0.3, 0.3);
GlRotatef (Angle, 0.0 f, f, 1.0 0.0 f);
Angle++;
GlmDraw (pModel GLM_FLAT);
}
GlutSwapBuffers ();
}
CodePudding user response:
Search online tutorial "learning OpenGL make up 3 d games"?CodePudding user response:
Can be divided into the viewpoint of rotation and model posture changeThe latter position change matrix is calculated by the yourself, glMultMatrixd (M) can change the position of the matrix, at the same time with this matrix multiplied by the target coordinates after the transformation
CodePudding user response: