|
Imagine a globe (sphere). I have Point A (Miami FL) and Point B (Portland OR). I would like to rotate the globe so that:
I have been using Quaternion.FromToRotation but I have not been able to come up with a good solution. Any suggestions? Thanks, Mike Edit:
(comments are locked)
|
|
I hope i understand it right. If so i had a similar problem yesterday. I used this:
Also instead of using a Vector you rotate it should work if you use the rotation on a transform.rotation of a GameObject. Edit: So i played around a little bit. I added one sphere in the middle of my scene, and two cubes.
http://unity3d.com/support/documentation/ScriptReference/Quaternion.Slerp.html was the function which helped me, it worked for me but im not sure if this is the best way to do it I am not quite sure how to implement your suggestion. The output seems to be a point and I think I am looking for a rotation.
Jul 09 '10 at 08:06 PM
Mike Miller
(comments are locked)
|
|
I think you are on the right track with FromToRotation. for the following to work your sphere would have to be at global (0,0,0)
if your sphere is not at global (0,0,0) you need to make sure that pointA and pointB relative to the sphere coord system and then use the following: Thank you. This worked.
Jul 13 '10 at 09:42 PM
Mike Miller
I posted the full code I used below.
Jul 13 '10 at 09:52 PM
Mike Miller
(comments are locked)
|
|
cnc guy helped answer my question. This is the code I ended up with. It allows a user to grab a point on a sphere and rotate the sphere from that point.
(comments are locked)
|
