Comments and answers for "how to convert the angle to roatation?"
http://answers.unity.com/questions/798107/how-to-convert-the-angle-to-roatation.html
The latest comments and answers for the question "how to convert the angle to roatation?"Comment by robertbu on robertbu's answer
http://answers.unity.com/comments/799788/view.html
In addition to the signed angle, you need the axis. If you have the axis, you can do:
transform.rotation = Quaternion.AngleAxis(angle, axis) * transform.rotation;Mon, 29 Sep 2014 14:25:30 GMTrobertbuComment by gopics on gopics's answer
http://answers.unity.com/comments/799719/view.html
hai mr.robertu ......actually i have the signed ange between two directional vector....using that angle how can i achieve the rotation??? is there possible to rotate the car using angle???Mon, 29 Sep 2014 11:58:46 GMTgopicsAnswer by robertbu
http://answers.unity.com/answers/798113/view.html
Vector3.Angle() does not help you since the result is unsigned. Given the forward vector of your vehicle and a vector indicating where you want it to point you can create a Quaternion:
var q = Quaternion.FromTo(myForward, nextDirection);
...then you can set the rotation immediately by:
transform.rotation = q * transform.rotation;
...or you can do it over time with easing by:
transform.rotation = Quaternion.Slerp(transform.rotation, q * transform.rotation, Time.deltaTime * speed);
For a vehicle, you sometimes want to force the angle of rotation. Assuming you've defined the front of your vehicle as the side facing positive 'z' when the rotation is (0,0,0), you can use Quaternion.LookRotation():
var q = Quaterion.LookRotation(nextDirection, transform.up);
...and the Slerp would be:
transform.rotation = Quaternion.Slerp(transform.rotation, q, Time.deltaTime * speed);
Note for a non-eased rotation, Slerp() can be replace by RotateTowards(). 'speed' would then be measured in degrees per second and would have to be greatly increased from the value used in Slerp().Fri, 26 Sep 2014 14:39:59 GMTrobertbu