[ODE] Problem with hinge

Marco Vienup Marco at vienup.de
Fri Dec 27 02:21:01 2002


This is a multi-part message in MIME format.

------=_NextPart_000_006C_01C2AD92.61E54100
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,
i have st=EDll a problem with the hinge :)
The Geometry looks like this:

---Box---FixedJoint---Sphere---Hinge---Box---FixedJoint---Sphere

Z  Y
|  /
| /
----X

My "hinge code" looks like this:

 //Hinge
 m_hinge=3DdJointCreateHinge(worldID, 0);
 dJointAttach(m_hinge, m_pLegElementA->getSphereBody(), =
m_pLegElementB->getBoxBody());
 dJointSetHingeAnchor(m_hinge, 0.9, 0, 1);
 dJointSetHingeAxis    (m_hinge, 0.9, 1, 1);

What I want to do is, to connect the two elements, that they can only =
rotate around the Y axis.
But with this code it seems that there is more than one axis ?!
(Pointers etc are correct, I checked them...)
Where must be the exact postion of the axis ? (I thought that the vector =
between the anchor position
and the axis position is the axis, but it seems not...)=20
Must I adjust the position each simulation loop, or are they fixed after =
I set them ?

It can=B4t be so complicate please help :o)

Thx
Marco Vienup


------=_NextPart_000_006C_01C2AD92.61E54100
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i have st=EDll a problem with the hinge =

:)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The Geometry looks like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>---Box---FixedJoint---Sphere---Hinge---Box---FixedJoint---Sphere=
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Z&nbsp; Y</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>|&nbsp; /</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>| /</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>----X</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>My "hinge code" looks like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;//Hinge<BR>&nbsp;m_hinge=3DdJointCreateHinge(worldID,=20
0);<BR>&nbsp;dJointAttach(m_hinge, m_pLegElementA-&gt;getSphereBody(),=20
m_pLegElementB-&gt;getBoxBody());<BR>&nbsp;dJointSetHingeAnchor(m_hinge, =
0.9, 0,=20
1);<BR>&nbsp;dJointSetHingeAxis&nbsp;&nbsp;&nbsp; (m_hinge, 0.9, 1,=20
1);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What I want to do is, to connect the =
two elements,=20
that they can only rotate around the Y axis.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>But with this code it seems that there =
is more than=20
one axis ?!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>(Pointers etc are correct, I checked=20
them...)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Where must be the exact postion of the =
axis ? (I=20
thought that the vector between the anchor position</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>and the axis position is the axis, but =
it seems=20
not...) </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Must I adjust the position each =
simulation loop, or=20
are they fixed after I set them ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It can=B4t be so complicate please help =
:o)</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thx</DIV>
<DIV>Marco Vienup<BR></DIV></FONT></BODY></HTML>

------=_NextPart_000_006C_01C2AD92.61E54100--