Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to re-orthogonalise vectors


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
20 replies to this topic

#21 Norman Barrows   Crossbones+   -  Reputation: 1990

Like
1Likes
Like

Posted 07 April 2013 - 05:22 PM

Is this the sort of thing that I'm after? I removed the current orthogonalising routine I've got (cross products, etc...) and put in the D3DXQuaternionNormalize() part.

 

this is very off the cuff here...

 

you want to do a D3DXQquaternionIidentity(myquat) to get your ship started out lined up with the world axes.

 

then its time to turn.

 

D3DXQuaternionYawPitchRoll(tmp_quat,yaw,pitch,roll)

 

D3DXQuatenarionMultiply(&myquat,&tmp_quat,&myquat);

 

then normalize

 

D3DXQuatenarionNormalize(&myquat,&myquat)   // not sure if you can call it that way, might have to be &tmp,&myquat, followed my myquat=tmp.

 

i have yet to try quats myself, but when i was looking for all the pieces, these are what i found.

 

you can also use D3DXQuatenarionRotationAxis to do rotations about individual local axes, or any arbitrary axis.

 

when its time to draw or you need the equivalent matrix, you use

 

D3DXMatrixRotationQuatenarion(&myMat,&myquat);


Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS