[gameprogrammer] Re: RES: Re: Math Question

On Sun, 2007-09-09 at 23:47 -0300, Edilson Vasconcelos de Melo Junior
wrote:
> 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.

That's exactly what I mean :)

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

I'd think it would depend on what you're trying to do.  If, for example,
you were concerned about the different between a vector (V) forming an
angle (A) with VectorRight and attempting to differentiate between, say,
whether A is directed "above" VectorRight or not, you could dot A with
another vector (say VectorUp), and take the sign of that dot product to
indicate more precisely the orientation of A and VectorRight.

Otherwise, I'm pretty sure most applications of the dot product work
without any trickiness.  It'll give you the parallel component of one
vector to another, and can help in finding the cosine/value of an angle.

> 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
> 
> 
> 
> 
> 


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


Other related posts: