Phil Williams
Phil Williams

Reputation: 53

OpenGL vertices being rendered clipped

I haven't done much OpenGL stuff, I assume there is an obvious cause of what I am seeing.

Basically the pictures below explain everything.

The only thing changed between the images is the x rotation on the projection matrix.

OpenGL 1.1 on Windows.

Any help is much appreciated.

Good

BAd

Upvotes: 1

Views: 56

Answers (1)

datenwolf
datenwolf

Reputation: 162269

This looks like a ortho projection. I suggest you increase the range between the near and far value. Unlike perspective projection, where due to nonlinearity you should limit the near-to-far range to what's absolutely necessary, you can safely choose a near/far range for ortho that's very wide without running into trouble. I suggest you use [-1000, 1000] (with a 24 bit depth buffer that gives you a depth resolution of ~1/8000 viewspace Z units).

Upvotes: 2

Related Questions