[ODE] Trimesh Sphere Interactions - how to break 'test_trimesh.cpp'

Alex Green alexg at acfr.usyd.edu.au
Sat May 21 16:30:58 MST 2005


Thanks to all those who responded.
I had two simple 'bugs' and I confused the two making it harder to find.
First: I assumed clockwise winding meaning that my data worked upside down.
Second: When passing the data to dGeomTrimeshBuild...(), you have to 
pass the number of vertices and the number of indices.
The number of vertices is one for each (x,y,z) point (Three floats).
The number of indices is one for each (px) pointer (One int).
With the indices I passed one for each (p1,p2,p3) triangle (Three ints).
Thus two thirds of my data was ignored by ODE/OPCODE!
As my data sets were large they typically worked fine or didn't work at 
all as I was only exploring a small part of the area...

So, true to my word I will add a section next week to the WIKI on how to 
use trimesh for the new people out there.
I will also conduct some experiments on the effect supplying normals in 
future, but for the moment I have gone back to letting ODE generate them.

Cheers -alex

Patrick Enoch wrote:
> Unless you are generating some non-standard normals for the mesh, its  
> probably safer to
> let ODE generate them for now.
> 
> Each triangle of the soup has its own orientation (front/back)  
> determined by its normal.
> 
> When passing vertices and normals to ODE watch out you use the  correct 
> buildXXX function. There will be
> no error checking and you just get weird results. This is related to  
> double and float builds of ODE and
> also passing the correct "triangle-stripe".
> 
> normals must be passed as a double/float[3][x] array. have a look at  
> the collision function for that. also
> have a look there for ODE generation of normals there.
> 
> Patrick 

>> Also what is the effect of passing the normals? I pass the normals  to 
>> buildSingle1() and I draw them for debugging, and my mesh looks  like 
>> a nice little hedgehog with all the normals pointing upwards,  but 
>> seams to have little effect on the behavior of the system.
>> I will have a play with the winding and will try some of my  
>> experiments on test_trimesh.cpp. Anything interesting I will post.
>>
>> NORMALS: what does passing them to
>> dGeomTriMeshDataBuildSingle1(, , , , , , ,normalsPTR) do?
>>
>> Any more detail on how ODE interprets winding order and collisions?




More information about the ODE mailing list