[ODE] Trimesh question - Normal Direction

Alex Green alexg at acfr.usyd.edu.au
Mon Oct 2 22:24:33 MST 2006


Normals: if you don't supply them ode calculates them. It calculates them 
in a counter-clockwise direction (or winding).

What does this mean:
Imagine a triangle on your desk and the three points (in the order given to 
ODE) are the top point, the bottom left point and last the bottom right point.
Then the normal points up off your desk towards you, the outside is the top 
side. Reverse the direction you give the points to ODE and the normal 
points down.

Please correct if i am wrong. When testing I added a temporary 
'drawNormal()' function to drawstuff to see which way around my trimeshs were.

Next, for the physics and collision use a number of boxes to make up the 
shape and mass distribution of the car (I use one large box for the body, 
one heavy one for the engine, two for the bumpers and a couple for the top 
of the vehicle). ODE works very well like this. When you visualise your 
simulation use a nice looking trimesh.

Best of both worlds.

Cheers -alex

Pavel Mach wrote:
> Hello,
> I have a problem which I am not able to fix. When creating trimesh, 
> there is no needed to support normal vectors as I can read in the wiki 
> manual. But will the trimeshs behave the same if I let the ODE to hendle 
> the normals itself or if I support the face normals? What are the 
> normals for? Is it possible that if I make the mesh with inverted 
> normals, that the collisions will be different?
> 
> I am asking because I have a problem with trimesh, but I cannot find a 
> solution, so I am thinking about the normals now... I made a video about 
> it, you can dowload it below.... I made some cars, every car is a body 
> with 4 cylinders for wheels connected to car-body with hinge2.
> When I use simple BOX geom for car's body, the colisons looks like in 
> video 1. When I use the trimesh for car body (the trimesh is the same 
> like in the car rendered in video), the collisions look strange like in 
> video 2 - the cars are "kicking hard" to themself when touched. It's 
> obvious from the movies, it's hard to explain.
> When I "tune" the contact-cfm and erp, it's little bit better (I set the 
> worse cfm and erp in purpose for the video) but it's never good enough 
> like in video-1 when just a box geom is used. I explain it to myself 
> that it's exactly because of setting ERP and the "correcting force" when 
> two bodies are overlapping, but I am not sure and I don't know even how 
> to "fix" it. So is it possible to fix this problem somehow?
> 
> And I have another question :) : A simple box geom for a car is not good 
> enough for the car body, but instead of using trimesh body, I would use 
> a couple of small boxes for representing the body, it would be about  20 
> or 50 or even 100 boxes per a body. Do you think it's applicable to 
> represent a object in scene with this amount of simple geoms? Can ODE 
> handle it and wouldn't it be even faster than represent it with a 
> low-poly-trimesh (with about the same number of triangles, say)?
> 
> VIDEO1 (box geom):
> www.xtopi.com/ode/box_geom_car.avi
> 
> VIDEO2: (trimesh geom)
> www.xtopi.com/ode/trimesh_geom_car.avi
> 
> Thanks for your suggestions.
> pavel mach
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 


More information about the ODE mailing list