1

I am showing a textured sqad, centered around [0,0,-10], width and height = 10000. The camera is positioned at [0,0,0] and looks down the negative z-axis (eyepoint=[0,0,0], center=[0,0,-1]):

GLU.gluLookAt(gl, 0f, 0f, 0f, 0f, 0f, -1f, 0f, 1f, 0f);

Lighting and Depth-Test are disabled.

In orthographic mode, the squad is displayed perfectly, with texture and all - I can even zoom and pan around. However, when switching to perspective mode, via:

GLU.gluPerspective(gl, 60.0f, w / h, 1.0f, 1000.0f);

then the view is just blank. Has anybody got any idea what could cause this?

UPDATE:

Using glFrustum instead of gluPerspective, it works:

gl.glFrustumf(-scaledHalfW, scaledHalfW, -scaledhalfH, scaledhalfH, 1.0f, 100.0f);

But why does gluPerspective not show anything?

manmal
  • 3,900
  • 2
  • 30
  • 42

1 Answers1

4

Is w / h an integer division maybe?

Tim
  • 35,413
  • 11
  • 95
  • 121
  • 1
    it is! omg feeling stupid right now :) w/h will be 0, distorting the viewport to exactly 0 width. – manmal Mar 22 '12 at 17:55