Home > Software engineering >  OpenGL object appeared in the process of rotating the back of the block in front of the object, ask
OpenGL object appeared in the process of rotating the back of the block in front of the object, ask

Time:10-03

As shown in figure 1 and figure 2, figure 1 from the perspective of the three-dimensional objects is normal, but the rotation to figure 2 view appears at the back of the hole post ran to the front to display the phenomenon, I have already started the depth test:
GlClear (GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
GlEnable (GL_DEPTH_TEST);
GlDepthFunc (GL_LEQUAL);

But I don't know why can appear such circumstance, also hope to get down to help wow, thank you!

Figure 1

Figure 2

CodePudding user response:

Search online tutorial "learning OpenGL 3 d games",

CodePudding user response:

Which chapter related content? If you know if you could help me to solve it? Compare the worry ~

CodePudding user response:

Note the difference between the left hand coordinate system and right hand coordinate system,

CodePudding user response:

How do you spin? Is a rotating object or change the viewpoints in the LookAt position?
  • Related