[ODE] trimesh and making your own mesh
nearaz
nearaz at interamotion.com
Sat Jul 19 01:04:02 2003
>> IMHO, specific geometry format loading functions don't belong to
>> ODE core (though they might go to 'contrib' or somewhere)...
>
> I get your point .. I just am looking for a way to avoid the math..
> though I got a 3d math book I am going to go through since its so
> difficult to do much without understanding the math
There's absolutely no math involved in taking data from exported mesh; and
feeding it to tri-mesh. The exported mesh is a bunch of vertices (that, among
other things, have their xyz positions), and a bunch faces (usually
triangles). Now, tri-mesh needs a bunch of vertices (xyz's), and a bunch of
triangles (that is, 3 vertex indices for each triangle). So, your task is
just to route that data. No math :)
>> Yes, that makes sense. That's how everybody is doing,
>> at least :)
>
> other people are making ODE geom use max and importing the
> coordinatees with trimesh? What performace penalty is there..
> for examples.. if I dropped 20 of those bunny rabbits in
> test1.exe onto a plane vs. 20 boxes
I'm not saying that other people are using ODE and tri-meshes (but that's
also true)... But generally people don't describe everything with boxes and
spheres...
Using only meshes has it's problems (eg. mesh-mesh collision is easy, but
finding contact points/normals/depths is extremely hard, especially for
realtime). BTW, ODE doesn't have this yet (mesh-mesh collision).
But it makes sense to have mesh-sphere, mesh-box etc. collisions. The most
widely used case in games is having mesh for "the level", and using
spheres/capsules/boxes for "actors" (humans, vehicles, bullets etc.).
What performance penalty does that bring (compared to using a bunch of
boxes/spheres instead of trimesh) - depends on the situation. It might be
faster, it might be slower. But it's possible, in realtime.
What are examples of ODE and tri-meshes:
Juice (http://www.natew.com/juice) has some tri-mesh support (terrain?).
LTGameJam2003 (http://jammy.sourceforge.net/2003/) has tri-meshes
for "level", and spheres+boxes for cars.
> I figure 5 years from now we will be using near exact
> representations for the mesh rather than boxes
I guess we're already doing this for several years :)
> also. are there any source code tutorials for ODE? I know about
> drawstuff... but I sure would like some examples that built on it
> itself... like a box.. to 5 boxes together.. to 5 boxes linked using
> joints..
There are "tests" in ODE, they can serve as tutorials... And there are docs
for ODE, so you've got everything you need :)
Aras Pranckevicius aka NeARAZ
http://www.gim.ktu.lt/nesnausk/nearaz/