PDA

View Full Version : Depth problems



mfarrell
04-10-2001, 12:23 PM
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?

IsaackRasmussen
04-10-2001, 01:07 PM
setting the farplane range further away should do it... did you try that?

gluPerspective(fov,viewaspect,nearplane,farplane)

mfarrell
04-10-2001, 03:26 PM
..n...nn..nnno I didn't

I thank you

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

mfarrell
04-10-2001, 04:25 PM
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

mfarrell
04-10-2001, 04:27 PM
I should also mention that chainging the fov to any other value made no change whatsoever to my output

(using allegro gl)

Tilgovi
04-10-2001, 05:01 PM
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

mfarrell
04-11-2001, 02:07 AM
Didn't work.........

I'm using allegro gl under Linux

HFAFiend
04-11-2001, 11:12 AM
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.

mfarrell
04-11-2001, 04:54 PM
how do I disable the z buffer
(gl newbie)

IsaackRasmussen
04-12-2001, 03:05 AM
You disable it by writing,
glDisable(GL_DEPTH);

NeoTuri
04-12-2001, 04:55 AM
You mean glDisable( GL_DEPTH_TEST ) ?

IsaackRasmussen
04-12-2001, 05:09 AM
Neoturi,

yeah, oops.

Thanks,

Isaack

mfarrell
04-12-2001, 06:31 AM
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....

NeoTuri
04-12-2001, 06:34 AM
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).

mfarrell
04-12-2001, 02:53 PM
Problem solved (on the allegro forums lol).

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

ty

~Mike