I'm new to OpenGL, and I'm going through some tutorials and various other web sources, To test things like everything from HUd to more things, after a long night, I can not get to do this work and I can not find any solution here, so I thought I Want to
My code:
Glow glidehow (glovid) {GluT Atrab (GL_lighting_it | GL_DEPTBUUFFABIT | GL_TEXTURE_BIT); GlDisable (GL_LIGHTING); GlDisable (GL_DEPTH_TEST); GlDisable (GL_TEXTURE_2D); GlMatrixMode (GL_PROJECTION); GlPushMatrix (); GlLoadIdentity (); Glotho (0.0 f, 1.0 f, 0.0 f, 1.0 f, -1.0 f, 1.0 f); GlRasterPos2f (0.1 F, 0.6 F); GlColor3f (1.0f, 1.0f, 1.0f); GlPrint ("test."); GlRasterPos2f (0.0f, 0.0f); GlPopMatrix (); GlMatrixMode (GL_MODELVIEW); GlPopAttrib (); GlEnable (GL_TEXTURE_2D); GlEnable (GL_LIGHTING); GlEnable (GL_DEPTH_TEST); } is the code to present the text, and this is the code for drawing the scene:
int DrawGLScene (GLvoid) {glClear (GL_COLOR_BUFFER_BIT) | GL_DEPTH_BUFFER_BIT); // Clear Buffers Gloulode Identity (); // if i put glLoadHUD (); Here, it renders but the models are presented above, which is useless. (XLOP = 0; XLOP & lt; 3;) {glLoadIdentity (); GlTranslatef (-4.0f + (name (xloop) * 4.0f), 0.0f, -12.0f); GlCallList (dlstBox); // This is a box to make a call. Xloop ++; } GlLoadHUD (); // If I place it here, it does not render exactly the return TRUE; } Thank you in advance for any help, which you can give, I know that I am very green and I am sure that it is staring me in the right face , But this is driving me crazy. I'm not sure how it works.
The matrix is still on the stack, and you do not delete it as part of the glLoadHud . Thus, when you have all the glTranslatef translations gathered during the scene are still active, when you are hugging the hood, which translates it out of your viewable window. as part of the introduction of glLoadHud the code> Modewiv matrix and see if it makes any difference.
Comments
Post a Comment