Pergunta

i have just started using c++ and OpenGL after using java and very little LWJGL. i have been following these tutorials http://ogldev.atspace.co.uk/ and around tutorial 13 i started to play around a bit my self. After creating some pyramids and controls to move around i noticed that looking at the objects from one angle they look normal but looking another angle objects behind other objects are being rendered in-front. i have already looked at this question

Background object is drawn in front of foreground object in OpenGL?

and didn't find an answer so now i'm so confused and decided to make a stackoverflow account and ask a question. i would post pictures but i don't have enough reputation so here is a link to them (there are 3 in a zip file)

http://www.mediafire.com/download/hucfisn0jytah7o/Game%20screenshots.zip

[EDIT]

Also i though you might need to know, i am using freeglut and glew (may not be the best choice but i like it) and Visual Studio 2012, Windows 8.1 (just got a new laptop and haven't got windows 7 installation disc)

Foi útil?

Solução

It sounds like you need to enable the depth test in opengl:

glEnable(GL_DEPTH_TEST);

Otherwise I would need to see where you set up opengl.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top