[ODE] Questions about representing motion in ODE

Jean-Sebastien Guay jean-sebastien.guay at polymtl.ca
Sun Mar 12 20:33:12 MST 2006


Hello Jon,

Thanks a lot for your reply. I'm still trying to get the hang of modeling this
kind of thing using a physics library...

> I would model this as two forces:

Ok, that's interesting. I assume those two are in addition to the forward force
I'm applying as thrust, since they both have a very small multiplier in them,
correct? Also, I assume I'd have to apply both at every time step, using the
time between frames as a multiplier too?

> For a submarine, I'd probably model the depth as a desired depth, and
> add a force towards the desired depth that depends on the distance to
> the depth and the current velocity. An alternative is to just do the
> same thing as for sideways force (in case 2 above).

Actually, since we're in an arcade concept, we were going to make the sub move
more or less like an airplane in that respect. If we need to go toward the
bottom or the surface we point the sub down or up and it goes that way. We
might add a way of going straight up or down when stopped, but it won't be the
primary movement mode.

> > Also, is there a better way to model the sub's rotation? For now, I just
> > get yaw and pitch from reading the mouse and change m_Direction (and other
> > vectors) to reflect that, but would it be better if I applied for example a
> > torque or something like that? How would I do that to get what I want?
>
> Use a controller. You want rotation X, but you currently have rotation Y
> with rotational velocity R. Apply a torque which is proportional to
> (X-(Y+R*TimeStepSize)), each step. This will make the sub "trend"
> towards the rotation you want. This works fine in euler angles, although
> there is some inaccuracy due to the cubic as opposed to square
> coordinates). In an arcade game, nobody will notice.

Err, I'm going to have to ask you to take it a bit slower... What's a
controller? I didn't see that in the ODE User Guide. What does Rotation X,
Rotation Y and Rotational Velocity R represent? (yaw, pitch and turn rate I
guess?)

Basically, we would like the mouse X and Y axes to control yaw and pitch more or
less. If the sub is stopped, it would just rotate about itself, and we could
point it in any direction with those two axes. Would what you suggest work for
that?

Thanks in advance,

J-S
--
______________________________________________________
Jean-Sebastien Guay     jean-sebastien.guay at polymtl.ca
                         http://whitestar02.webhop.org


More information about the ODE mailing list