Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Rotation Math Help

Discussion in 'Scripting' started by Lemmiwinqs, Mar 10, 2016.

  1. Lemmiwinqs

    Lemmiwinqs

    Joined:
    Jun 22, 2015
    Posts:
    9
    Hi guys. Any help appreciated.

    I have this problem with rotating 3d globe. I tried to use LookAt function with no result.
    Ok so, object is 3d globe (understand earth). I need it it to show any given point in camera view. So if I pick country, say canada, earth will rotate so i can see canada in the middle of camview.
    LookAt function seems to rotate Z axis so it points to point in space. I need custom vector (canadapos - earthcenter) to "look at" my camera position.
    Thanks in advance for any help.
     
  2. Magison

    Magison

    Joined:
    Mar 1, 2013
    Posts:
    21
  3. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    Quaternion.LookRotation takes 2 parameters, try that, specifiying different vectors for the different axes