[ODE] Newbie: integrating ODE with other graphics toolkits
Vadim Macagon
vadim_mcagon at hotmail.com
Mon Aug 11 03:49:02 2003
> Am I basically forced to represent all geometric data twice, once for ODE
> to simulate in and once for the scene graph to render. Both of course use
> totally different formats. Assume a little map with a few objects and a
> player controlled thing, I probably have to represent the map geometry,
> the object and actorse in both ODE and the chosen 3D toolkit (OSG in this
> case)?
Usually what you render is a whole bunch of triangles, most geoms in ODE
don't
consist of triangles, you use different representations of the same object
for different things. Even for a tri-mesh geom which you may use to
represent your terrain you might want to use a lower resolution mesh than
what you'll actually be rendering.
> Any good sample app that I could have a look at and learn from? Or some
> RTFM resources?
You might want to look at ODE's drawstuff library (to see how it works).
Basically you just need to know what the orientation & position of each
body/geom in your simulation is, so you can render the corresponding visual
objects in the right place and with the correct orientation - use
dGeomGetRotation, dGeomGetPosition, dBodyGetRotation, dBodyGetPosition to
figure that out.
> Thanks in advance,
> Jan Ekholm
Cheers,
Vadim.