Does anyone have any advice or tricks/techniques for debugging invisible geometry in OpenGL? I found stuff for Direct3D and when I first started writing my D3D driver for my engine it really helped, but I haven't been able to find anything like that for OpenGL. Only things referencing the word "missing" with the word OpenGL is usually referencing missing DLLs or Extensions or files, or textures, etc.
I can't figure out which piece is the problem, I know I took the matrix functions collapsed them down to a single dimensional array of floats, since everything I read kept saying in memory it's contiguous and you can exploit that (Though I still feel like a transpose needs to be taken ..somewhere...) but now when it comes to drawing just a simple cube, I get nada in my window. The window clears to the right color that I specify, just the cube doesn't show up. The cube is being fed in data from a file (Which uses routines I know work -- as the D3D driver does), the only other "trick" (Other than collapsing the matrices) I had read about converting D3Dmatrices to OGL is after the projection is set (Via a call to glMatrixMode(GL_PROJECTION) and glLoadMatrixf), issue these two gl statements:
glScalef(1, 1, 2);
glTranslatef(0, 0, -1);
I suppose maybe the z value of each vertex coord needs to have its sign inversed (- if + and + if -) or maybe just the meshes position, but I tried that. I have culling disabled, I have lighting disabled. So I ran gDEBugger peeked into the VBO and found that it seems like only half of my VBO is being set, despite breaking in Visual Studio at the end of my loop that feeds the interleaved array -- confirming there are indeed enough floats to fill the VBO yet the "bottom-half" of the list in the VBO, according to gDEBugger, is all NA.
There should be 288 float values for the VBO; here's my calculation of it:
3 points per face
being a cube and working with GL_TRIANGLES, there are 2 faces per poly (I guess this terminology might be backward... eh.)
each point contains 2 texture floats (u and v), 3 normal floats (x, y, and z) and 3 vertex floats (x, y, and z) -- 8 floats per point
2 faces per side * 12 sides = 36
so the end calculation is 36 * 8 = 288 floats in a 1d array; yet in gDEBugger I see only up to line 17 filled in (18, if you count 0 -- which you should), that's half of 36; and only 6 sides. Can a partially filled VBO still render? Or have I found my culprit? (Either way I know it's not good.)
I'm guessing you guys will need some code as it may be hard for you to tell from descriptions; so just lemme know. Any help would really be appreciated, I'm wasting waaay too much time trying to get a single cube to render. Thanks!