Re: Constrained quaternion rotation
- From: "Dave Eberly" <dNOSPAMeberly@xxxxxxxxxxxxxxx>
- Date: Mon, 20 Oct 2008 07:44:53 -0700
"Alberto Bencivenni" <info@xxxxxxxxxxx> wrote in message
news:c1ccd40f-ff86-4b4b-9b51-a3e72c509c3d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I tryed also this, and the result is that the model rotates around one
World axis.
We are looking to pin down one axis to a World plane instead, it will
move too but always in that plane.
You have a model orientation, and then you have rotations of that
model. My understanding of your problem description is that you
want one axis of the model orientation to be in the world yz-plane
after each rotation is applied. My mistake in suggesting the closest
x-quaternion is that I imagined two axes pinned to the plane, in which
case the third axis is the x-axis and you rotate about it.
Reviewing my first response to your post, what is your objection to that
method? After each rotation is applied to the object, you apply a second
rotation (a "correction", so to speak) to force the body z-axis onto the
world yz-plane. There are infinitely many correction rotations, because
the model can rotate about its body z-axis through any angle you want.
You can constrain this by choosing the body-z-axis-angle so that the
body x-axis and body y-axis are as close as possible to their values
before you applied the motion rotation to the object.
If you want, email to me the original object orientation and a sequence
of quaternions representing the rotations (without corrections). I can
quickly implement what I suggested here and send it to you. The final
rotations might not be what you want, but at least that will allow you
to quantify what you dislike about the behavior during rotations.
Your Quaternion ClosestX (Quaternion p, float minAngle, float
maxAngle) asks for minAngle and maxAngle that don't apply to our case.
My Quaternion class has *two* functions named GetClosestX. The
first listed in the header is
Quaternion GetClosestX() const;
and gives you the closest quaternion of the form cos(t) + sin(t)*i without
angle constraints on t. The second listed in the header is
Quaternion GetClosestX(const Constraints& rkXCon) const;
where you can specify angle constraints on t.
--
Dave Eberly
http://www.geometrictools.com
.
- Follow-Ups:
- Re: Constrained quaternion rotation
- From: Alberto Bencivenni
- Re: Constrained quaternion rotation
- References:
- Constrained quaternion rotation
- From: Alberto Bencivenni
- Re: Constrained quaternion rotation
- From: Dave Eberly
- Re: Constrained quaternion rotation
- From: Alberto Bencivenni
- Re: Constrained quaternion rotation
- From: Dave Eberly
- Re: Constrained quaternion rotation
- From: Alberto Bencivenni
- Re: Constrained quaternion rotation
- From: Dave Eberly
- Re: Constrained quaternion rotation
- From: Alberto Bencivenni
- Constrained quaternion rotation
- Prev by Date: Re: Constrained quaternion rotation
- Next by Date: Re: Constrained quaternion rotation
- Previous by thread: Re: Constrained quaternion rotation
- Next by thread: Re: Constrained quaternion rotation
- Index(es):
Relevant Pages
|
Loading