[ODE] Drawstuff vs. stack size?
Daniel K. O.
danielko.listas at gmail.com
Sat Jul 28 15:21:04 MST 2007
Tobias Zimmer escreveu:
> But if I try to move the brush, which would result in an impact on the
> little cylinders, the simulation
> stops and the debugger shows me a problem with the "setTransform" in the
> drawstuff.cpp. I guess
> the behaviour of the cylinders thus is calculated correctly, but it's
> too much for the drawstuff
> rendering. If I just don't "draw" the cylinders though using them,
> everything works alright!
I don't think the problem is in drawstuff. The setTransform() function
just allocates a transform matrix on the stack and sends it to OpenGL.
It could be that ODE is still overflowing the stack, but things just
blow up inside drawstuff.
That is, unless there's some obscure bug inside drawstuff - which would
not be a surprise, as drawstuff exist just for debugging purposes.
> This would lead to a following question: What could I use instead of
> drawstuff?
Just about 3D engine. Usually a 3D engine have a "SceneManager" class,
which is a collection of 3D objects (usually called "SceneNode"); each
object has a position and an orientation (defined by a rotation matrix
or quaternion). So you create a 3D object for each ODE geom, and after
each timestep, you get the position/rotation from ODE, and set it into
the 3D object.
One of the easiest 3D engines to get running is Irrlicht. My only
problem with it is that their API still only allows you to set the
rotation through Euler Angles; so transfering the rotation from ODE to
Irrlicht is always 3-step (extract quaternion from ODE into a
irr::Quaternion, convert it to Euler Angles, apply the Euler Angles in
irr::SceneNode).
--
Daniel K. O.
"The only way to succeed is to build success yourself"
More information about the ODE
mailing list