PDA

View Full Version : Disappearing sides



Mjiig
02-21-2012, 12:46 PM
Recently finished making a cube rotate using functions I wrote myself to calculate MVP matrices and such.

The cube appears and rotates, but seems to be partially transparent despite me telling it not to be, and sides disappear as they come to the front.

I expect it to look like this (http://upload.wikimedia.org/wikipedia/commons/7/70/OpenGL_Tutorial_Cube_primary_colors.png).

Code: http://pastebin.com/AuDVuUy5 (in a paste bin for brevity)
Shader files: http://pastebin.com/WFKdQY2x

Really sorry for the enormous code dump, but I've absolutely no idea whereabouts this error is coming from :( .
I can clarify on any of the allegro calls that aren't obvious.

Kopelrativ
02-21-2012, 02:00 PM
Not having looked at your code, but could it be that you hit the near cut-off of the frustum?

Mjiig
02-21-2012, 03:06 PM
Don't think so, firstly it's sides disappearing, not chunks of cube, secondly I've tried pushing the cube a long way back in the frustrum and the problem persists.
Thanks anyway :)

Mjiig
02-29-2012, 01:31 PM
Problem solved, complete brain failure, nothing to do with OpenGL. Had failed to tell Allegro that I wanted an OpenGL context with a depth buffer.
Thanks for the help anyway.
Angus