[ODE] angular motors

jnilson_99 at yahoo.com jnilson_99 at yahoo.com
Mon Jun 13 00:42:30 MST 2005

for what it's worth, i recently posted numerous
questions asking how to set the amotor angles of a
ball and socket joint.

hold your applause, but i did finally find the answer,

i grabbed the code from the existing function:


to wit:

  // get q perpendicular to both ax[0] and ref1, get
first euler angle
  dVector3 q;
  dCROSS (q,=,ax[0],ref1);
  joint->angle[0] = -dAtan2

  // get q perpendicular to both ax[0] and ax[1], get
second euler angle
  dCROSS (q,=,ax[0],ax[1]);
  joint->angle[1] = -dAtan2

  // get q perpendicular to both ax[1] and ax[2], get
third euler angle
  dCROSS (q,=,ax[1],ax[2]);
  joint->angle[2] = -dAtan2 (dDOT(ref2,ax[1]),

you might ask yourselve why didn't i just make my
joint a euler joint, the answer is i wanted to control
all 3 axis. a euler joint restricts 1 of the axis for
some god forsaken reason which i haven't figured out

anyway....i used the preceding code to tell the amotor
joint in USER mode what the angle is....

hope this helps someone,


More information about the ODE mailing list