This is a multi-part message in MIME format.
------_=_NextPart_001_01C6B143.201A880B
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
Hi,
I am working on an application where VRML objects are moved by other
objects which are collided with them. Doing this I use a radio mouse
with an attached marker ('manipulator'). To make the movement smooth, I
need to adjust the parameters (translation and rotation) of the
migrating object. For this purpose I use quaternions. So, I have a
quaternion which represents objects original rotation and translation
and using the code :
arUtilMatInv(gObjectData[SelectedMan].trans, wmat1);=20
arUtilMatMul(wmat1, ObjectData[gObjectData[SelectedMan].collide].trans,
wmat2);=20
arUtilMat2QuatPos(wmat2,q,p);
I have the translation and rotation between the manipulator's marker and
the object's own marker.
My problem is that I am - not being a specialist in the quaternion
theory - not quite sure what to do with those quaternions: I add up
translations and it works - the object doesn't change its position; I do
the same with quaternions: sum them up (or subtract when I release the
object). But the handed over object sometimes rotates, especially when
the angle between the markers in question is big.
In general, does anybody know the solution as to how to adjust the
quaternion's coordinates of the VRML object in order for it to stay
still on the screen when it changes its marker?=20
I would highly appreciate any suggestion.
=20
Serguei
------_=_NextPart_001_01C6B143.201A880B
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@p ... Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-GB link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>Hi,<br>
<br>
<br>
I am working on an application where VRML objects are moved by other =
objects
which are collided with them. Doing this I use a radio mouse with an =
attached
marker (‘manipulator’). To make the movement smooth, I need =
to
adjust the parameters (translation and rotation) of the migrating =
object. For
this purpose I use quaternions. So, I have a quaternion which represents
objects original rotation and translation and using the code :<br>
<br>
arUtilMatInv(gObjectData[SelectedMan].trans, wmat1); <br>
arUtilMatMul(wmat1, ObjectData[gObjectData[SelectedMan].collide].trans, =
wmat2);
<br>
arUtilMat2QuatPos(wmat2,q,p);<br>
<br>
I have the translation and rotation between the manipulator’s =
marker and
the object’s own marker.<br>
<br>
My problem is that I am – not being a specialist in the quaternion =
theory
- not quite sure what to do with those quaternions: I add up =
translations and
it works - the object doesn’t change its position; I do the same =
with
quaternions: sum them up (or subtract when I release the object). But =
the
handed over object sometimes rotates, especially when the angle between =
the
markers in question is big.<br>
<br>
In general, does anybody know the solution as to how to adjust the =
quaternion’s
coordinates of the VRML object in order for it to stay still on the =
screen when
it changes its marker? <br>
<br>
I would highly appreciate any suggestion.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>Serguei</span></font><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p></o:p></span></font></p>
</div>
</body>
</html>
------_=_NextPart_001_01C6B143.201A880B--
|