c++ - gluLookAt function won't work -
I am trying to change the position of the camera / view angle in one scene, but there is nothing The default view set in my salvage function (below) which I input into shows
myReshape zero (int w, int h) {glViewport (0,0, w, h); GlMatrixMode (GL_PROJECTION); GlLoadIdentity (); Glu Perspective (40, W / H, .5, 1000); GlMatrixMode (GL_MODELVIEW); GlLoadIdentity (); }
Every other problem with this function is usually the result of an inappropriate push-pop matrix or it is doing translation / rotation before or before calling it. I do not think I have any of these issues, though. This is my display function.
myDisplay void () {glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); GlMatrixMode (GL_MODELVIEW); GlLoadIdentity (); GluLookAt (0.0, 0.0, 0.0, 5.0, 5.0, 5.0, 0, 1, 0); Printf ("Error:% x", glGetError ()); GlPushMatrix (); // Current matrix glododent (); // Start a new temporary matrix for identification glTranslatef (0.0.0.0, -20); // Transfer the original layer back to glScalef (g_vLandScale [1], g_vLandScale [1], g_vLandScale [1]); // display change glRotatef (g_vLandRotate [1] / float (10), 0.0,1.0,0); Glottef (G_Walconotate [0] / Float (10), 1.0.0,0); GlRotatef (g_vLandRotate [2] / boat (10), 0,0,1); GlTranslatef (g_vLandTranslate [0], 0.0.0.0); GlTranslatef (0.0, g_vLandTranslate [1], 0.0); GlTranslatef (0.0.0.0,20); // Return to render at original placements (); RenderCrossBeams (); Renderground (); RenderSky (); GlPopMatrix (); GlutSwapBuffers (); }
Any ideas why it wont work? It stops completely on the line and nothing changes about this scene. I have tried to use these, floats, doubles, glufflots, broadballs, using hardcode numbers, after using them, before using them in push / pop block, nothing is working.
Comments
Post a Comment