[ODE] A trimesh-as-view-frustum question

Pierre Terdiman pierre.terdiman at novodex.com
Fri May 7 09:39:16 MST 2004


> First, if I were to have a large geom, say a cone or a pyramidical
> section described as a trimesh, would OPCODE detect when an object is
> completely inside? Or does OPCODE only detect intersection with the
> surface triangles?

For meshes, it only detects intersection with surface triangles.

> Second, if the first is true, I'd like to know what your collective
> thoughts are on using a trimesh view-frustum for visibility
> determination. As in, if I had a trimesh corresponding to my view
> frustum with my camera's position and orientation moving and orienting
> the trimesh, would it be an effective way to determine which objects in
> my simulation are visible?

There's no point in using a trimesh for frustum culling, just forget it.

The canonical way is :

Preprocesss :

1) Compute AABBs around static objects in your environment
2) Create a static AABB-tree from them

Runtime :

1) Extract frustum planes from the view/proj matrix
2) Do a frustum-query using extracted planes, Opcode's planes-collider, and
precomputed tree
3) Render returned objects

Notes :

1) It also works for dynamic objects with the Refit() function. However
resulting tree isn't great since there's no coherence between objects, and
they can move pretty much anywhere in an independent way. Refit() works
better for deformable meshes, whose structure has a certain coherence
despite the deformations. It means that for dynamic objects, another data
structure is better (loose octree, whatever)

2) You can use either the "vanilla" AABB-tree, or one of the "optimized"
tree with "primitive tests" disabled (since, for them, primitives are
supposed to be triangles - not AABBs around objects).


- Pierre




More information about the ODE mailing list