[ODE] Simulating with trimesh
henrikmo at idi.ntnu.no
Mon Aug 14 11:15:30 MST 2006
I managed to get the tool to fall towards the floor now by adding the code
below and extracting the position and rotation using the bodyid, which i
use to set the position and rotation of the OSG node/drawable.
dBodyID toolBody = dBodyCreate(world);
My new problem is that the tool falls from a distance above ground and
straight trough the plane. I tried increasing the contact points from 12
to values up to 1000, but no change. Any idea? Is it the 10.7.6
requirement for manual update? I had almost convinced myself that it
regarded trimesh-trimesh collision. The floor is of course just a plane.
My other object (a simple box) acts as expected.
I have looked at the test_moving_trimesh, but when pressing the button to
drop in a new rabbit it falls through the floor, so I guess that demo
isn't a too good start since I need the mesh to drop to the floor and stay
henrikmo at idi.ntnu.no wrote:
> Thanks, but could anyone go into more detail? I am really a beginner with
> this, and the fundamental knowledge of ODE is missing. Maybe a few lines
> of code to illustrate? I am able to set up a basic scene with a box or
> sphere and drop it onto a plane and make it collide. But that is about it
> unfortunately. How do I simulate with the trimesh (i.e. get rotation and
> position). Basically, what is inside the sim loop? Here is some of my test
> triGeomID triGeomId = dCreateGeomTransform(0);
> dTriMeshDataID triDataId = dGeomTriMeshDataCreate();
> visitor.accumData.vertices.size(), //this is a osg drawableVisitor
> dCreateTriMesh(space, triDataId, 0, 0, 0)
> What else do I need for the trimesh? The manual (10.7.6. Triangle Mesh
> Class) says I need to update the data manually. I didn't quite get this.
> ZHANG Zikai wrote:
>> 2006/8/14, henrikmo at idi.ntnu.no <henrikmo at idi.ntnu.no>:
>>> I have no experience with ODE so please excuse the stupid questions.
>>> I have loaded a .osg file and made a dTriMeshDataID with a call to
>>> dGeomTriMeshDataBuildSimple with the corresponding inputs. I have
>>> dGeomTransformSetGeom(geomid,dCreateTriMesh(space, triid, 0, 0, 0)),
>>> have no dBodyID for the.
>>> Is dBodyID required? If so, how do I do it for the trimesh?
>>> Is the dGeomID required for simulation since I am using OSG to draw?
>> The dBodyID could be 0, and the mesh becomes a static environment.
>> see 7.2. dBodyID dJointGetBody (dJointID, int index); in the ode user
>> guide :)
>>> The application is a glove controlled hand (several hinged boxes) which
>>> should be able to interact with the world by pushing away and possibly
>>> picking up different trimesh objects. Any tips? The hand should exist
>>> the simulation, but have no gravity and if it touches an object, as
>>> kinetic energy as possible should be transferred.
>> I am not sure of this will help, try directly call dGeomSetPositon when
>> glove is moving. Since the static geom has no body, contact attach may
>> not work, but when the collision has been detected you can attach the
>> geom yourself. Something like 'glove.curHoldingGeom'.
>>> There might be many followup questions :)
>>> Best regards
>>> Henrik Gundersen
>>> ODE mailing list
>>> ODE at q12.org
> ODE mailing list
> ODE at q12.org
More information about the ODE