Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualDoublefris

Posted 12 April 2013 - 09:07 AM

So I got it to work in XNA and it works beatifully, however using my own quaternion class or directx's quaternions the spaceship keeps 'flipping over' when you get behind on the Z axis it seems.  Is there something specific I'm doing wrong?

 

my basic algorithm is : 

 

 

Quaternion q1 = (shipforward, 0.0f)

Quaternion q2 = (shipposition - LookAtPosition, 0.0f)

 

then get the angular velocity using the method you described. weird thing is it works very well in XNA but trying to port it to my c++ engine keeps bringing this annoying bug.

 

A reason I thought of is that my division operator is wrong? what is the exact implementation of the division operator here?


#2Doublefris

Posted 12 April 2013 - 09:06 AM

So I got it to work in XNA and it works beatifully, however using my own quaternion class or directx's quaternions the spaceship keeps 'flipping over' when you get behind on the Z axis it seems.  Is there something specific I'm doing wrong?

 

my basic algorithm is : 

 

 

Quaternion q1 = (shipforward, 0.0f)

Quaternion q2 = (shipposition - LookAtPosition, 0.0f)

 

then get the angular velocity using the method you described. weird thing is it works very well in XNA but trying to port it to my c++ engine keeps bringing this annoying bug.


#1Doublefris

Posted 12 April 2013 - 09:01 AM

So I got it to work in XNA and it works beatifully, however using my own quaternion class or directx's quaternions the spaceship keeps 'flipping over' when you get behind on the Z axis it seems. Is there something specific I'm doing wrong?


PARTNERS