Depth problems

I am currently porting my 3d engine to opengl. My problem is, opengl cuts off anything past a certain depth from the camera. So you can barely see ahead of you. I’ve tried everything I could and all I can do is make the distance shorter but not longer. My current 3d world is over 1000.0 units wide so I need alot of space. Any ideas?

setting the farplane range further away should do it… did you try that?

gluPerspective(fov,viewaspect,nearplane,farplane)

…n…nn…nnno I didn’t

I thank you


Mike Farrell (Kain) http://vulcan.spaceports.com/~ltsword

thanks again but…still didn’t work, no matter what I do it will cut off the polygons if are some constant distance from the camera… (I can post a SS) if it’ll help describe my problem

I should also mention that chainging the fov to any other value made no change whatsoever to my output

(using allegro gl)

I don’t know if this is your problem, cause you didn’t mention platform. But for MacOS you may need to change AGL_DEPTH_SIZE, <depthsize> in the context attributes to be larger, or to exist at all.

-Tilgovi

Didn’t work…

I’m using allegro gl under Linux

Does it work without the z buffer on? If so then it’s probably because you need to fix something having to do with depth testing.

how do I disable the z buffer
(gl newbie)

You disable it by writing,
glDisable(GL_DEPTH);

You mean glDisable( GL_DEPTH_TEST ) ?

Neoturi,

yeah, oops.

Thanks,

Isaack

Disabling the depth test just causes the z buffering to completely fail and for the polygons to not be culled…still leaving the problem with the range…

How far are these objects and what precision variables are you using? float/double?

I consistently get problems when using floats at far distances. One of which is a “vibration” effect from the loss of significant digits from multiplication (e.g. dot product/cross product).

Problem solved (on the allegro forums lol).

I didn’t know you had to select the projection matrix

ty

~Mike