Question

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?

Was it helpful?

Solution

Is w / h an integer division maybe?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top