Note that there are some explanatory texts on larger screens.

plurals
  1. USMike Deaton
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COThank you Andon, and everyone else who answered. I had the Y-axis reversed in glFrustum() by mistake. Thank you for pointing that out. I am not calling initGL() more than once. I did double check all my code and found 2 places where I had glEnd() and glPopMatrix() reversed by mistake. In regards to point 3: I was able to get the cube to draw on top of the tiles by using glFrustum(0,SCREEN_WIDTH,SCREEN_HEIGHT,0, -1,1); in set3d() and glOrtho(0,SCREEN_WIDTH,SCREEN_HEIGHT,0,-1,1); in set2d(); so apparently you can have the zNear set to <0 in glFrustum. Probably not right, but it works for now.
      singulars
    2. COThank you Trillian, I removed the pushmatrix() calls from my initGL() function. I will try glGetError() momentarily. Thank you Andon, I changed set3d() to use glFrustum(0,SCREEN_WIDTH,SCREEN_HEIGHT,0, 1.0F,3.0F);.
      singulars
    3. COYour answer makes sense Pavel, but the cube doesn't draw at all if I change the zNear value of the glFrustrum call. First I tried 0.1 then I went all the way to 0.00000001 and it won't draw. I changed the zFar to 3. I also commented out the set2d() so there is nothing else drawing on top of the cube just to be sure, and it draws fine if the zNear is 0, but if I change it I get nothing. I'm using a standard cube example. I tried a couple of examples. They both work at zNear 0, and don't work at anything else. Any ideas?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload