Quaternion to Torque

Hi experts.

First off, I am really frustrated. This is the fourth day I am trying to solve a really “simple” problem, but I just have too less mathematic background knowledge to make Quaternions work like they should.

My problem:

I have two Quaternions. I “just” want to rotate the object from hasRotation to wantRotation with a specific force. I have tried around 1001 ways, and either its spinning around wildly, or it starts spinning when I look up, or when I look back, or when I tilt the z axis.

My current (non working) code is:

Quaternion hasRotation = transform.rotation
Quaternion wantRotation = from another function.
Quaternion qWay = Quaternion.RotateTowards(hasRotation, wantRotation, .1F);
Vector3 way = qWay.eulerAngles - hasRotation.eulerAngles;
rigidbody.AddRelativeForce(way * maxSpeed, ForceMode.Acceleration);

This works as long as I don’t look up…

I wish I never had touched that Quaternions thing… but the first 2 days I have tried working with eulerAngles, but this gives weird results when I fly a loop with my vessel (the result is… or should be… that the vessel is upside down).

It works when I do transform.rotation = wantRotation, but of course thats not wanted, since I have to do it with angular velocity…

Help please :frowning:

I was looking for the same thing. Here’s an answer I found here that looked relevant:

http://answers.unity3d.com/questions/48836/determining-the-torque-needed-to-rotate-an-object.html