[gameprogrammer] Re: Math Question
- From: Madison McGaffin <greyhill@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Sun, 09 Sep 2007 22:27:18 -0400
On Sun, 2007-09-09 at 22:08 -0300, Edilson Vasconcelos de Melo Junior
wrote:
> Hi,
>
>
>
> I need some help to verify if my theory is correct
>
>
>
> 1) I have a rigid body and I apply a force in its back, then if
> a change it’s orientation (to a new quaternion), may I multiply the 3D
> vector force for the rotational matrix extracted from this quaternion
> to keep applying this force to it’s back?
Yes. But you might want to consider pulling the force from the back of
this object out of the quaternion (or the matrix from the quaternion) in
order to avoid rounding errors.
>
> 2) This rigid body has a VectorRight (pointing to the right side
> of the movement), when I change the body’s direction, if I multiply
> the 3D VectorRight again by the ratational matrix (from item 1) will
> it keep pointing to the right side of the movement? (I’m pretty sure
> it’s the same question as above, but I had to ask anyway)
Ditto above. Pulling VectorRight out of the quaternion will let you
make sure that VectorRight and whatever vector is popping out the back
of your object don't slowly creep towards one another or do something
else weird.
>
> 3) This body has a velocity V and I need to know the component
> of this velocity is paralel to the VectorRight. I thought about
> normalize V and dotProduct it with the VectorRight. But I think I’ll
> have math issues with this approach, since I can’t guarantee if the
> angle between those vectors is less than PI/2
>
Good idea. If the angle between these vectors is between PI/2 and
-PI/2, the dot product will be negative. If you're concerned about it,
throw out the value at that point :)
>
> Any help would be really appreciated,
>
> Dirso
>
>
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] RES: Re: Math Question
- From: Edilson Vasconcelos de Melo Junior
- References:
- [gameprogrammer] Math Question
- From: Edilson Vasconcelos de Melo Junior
Other related posts:
- » [gameprogrammer] Math Question
- » [gameprogrammer] Re: Math Question
- [gameprogrammer] RES: Re: Math Question
- From: Edilson Vasconcelos de Melo Junior
- [gameprogrammer] Math Question
- From: Edilson Vasconcelos de Melo Junior