PDA

View Full Version : octrees with frustum culling question



Walantis
02-02-2002, 03:20 AM
hello,

i've finally combined octree partitioning with frustum culling. everything seems to work fine. i process a scene with 10.000 triangles and the player moves thourgh the scene (in first person view).

but i have a question: should the FOV be updated when the player moves ?
because sometimes some groups get clipped away but they should be there, normally.

can anybody help ?

thanks in advance,

walantis

AndersO
02-02-2002, 11:04 AM
Yes, why not?

If you dont place it where the player is (update it) the frustum will ofcourse cull the wrong stuff.

Walantis
02-02-2002, 11:34 PM
Hello.

Is there a sophisticated way to calc. the FOV angle, near and far plane values ?

until now, i tried out some values which made my scene look good http://www.opengl.org/discussion_boards/ubb/wink.gif

thanks,
Walantis

AndersO
02-03-2002, 12:00 AM
You can just grab it from OpenGL directly. Check this: http://www.markmorley.com/

dorbie
02-03-2002, 03:13 AM
Why would the fov change as the eye moves?

It sounds like you have a bug. The culling frustum should match your projection matrix glFrustum in the frame it is culling for. If you still have missing data then you have a culling bug. Perhaps the position is incorrect or the culling frustum, or there is a more fundamental problem with your algorithm.

Walantis
02-03-2002, 11:33 AM
Hi,

so it's common that the fov angle and the near and the far plane values should stay constant (in fact, that would be the easiest method).

then i have to check again my frustum code...

thanks,
Walantis

AndersO
02-04-2002, 12:35 AM
Uhm.. Maybe I got it all wrong.

But if the player moves, why dont you need to update atleast the "d" component in the plane equation on the planes that makes up the frustum?. Since the those planes distance to the origin is changing. (Assuming we are talking in world coordinates here).

I've actually never checked the planes I get from OpenGL in my culling functions. I'll check "d" component later when I move my view, and get back here.

The frustum planes normals (abc components) would ofcourse not need to be updated when only moving though.

Also, if you move along some of the frustum planes you dont need to update that planes distance to origin. Odd case though.

[This message has been edited by AndersO (edited 02-04-2002).]

Walantis
02-04-2002, 08:38 AM
Hi,

I've solved the problem. I made some logical errors when drawing the octree (I draw every leaf 8x http://www.opengl.org/discussion_boards/ubb/wink.gif ).
So there where no culling errors but overdraw errors (which looked like culling errors).

bye,
Walantis