View Full Version : Disappearing sides

02-21-2012, 11:46 AM
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.

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

02-21-2012, 02: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 :)

02-29-2012, 12: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.