[gameprogrammer] RES: Re: Math Question

Hi, Thanks for the quick answer!

1) To avoid rounding errors, I'm extracting the Rotational Matrix from the
Quaternion on each frame and multiply the force for this matrix. Is that
what you mean? Ogre Engine doens't have a Vector3*Quaternion method
implemented.

3) My concern actually is how to deal with angles with the same cosine?

Thanks,
Dirso.

-----Mensagem original-----
De: gameprogrammer-bounce@xxxxxxxxxxxxx
[mailto:gameprogrammer-bounce@xxxxxxxxxxxxx] Em nome de Madison McGaffin
Enviada em: domingo, 9 de setembro de 2007 23:27
Para: gameprogrammer@xxxxxxxxxxxxx
Assunto: [gameprogrammer] Re: Math Question


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





-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 9/9/2007
10:17



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: