I tried this but it dont work as I expected(the results in euler had to be the same)...
The primary idea is to measure deviation of direction in euler angles from one vector3 to another.
The problem may be that you're using Vector3.up as the (first) argument to LookRotation(), which is likely to produce an invalid result. The second (optional) argument to LookRotation() is the reference vector, which defaults to Vector3.up. If the input vector and the reference vector are parallel or nearly parallel (as is the case in the above code), the results are likely to be invalid.
I'm a little skeptical regarding the usefulness of expressing a relative rotation in Euler-angle form, but I'll just assume you have a good reason for wanting to do that.
answered Dec 10 '10 at 04:19 AM