Search code examples
maththree.jspolar-coordinatescartesian-coordinates

Convert three.js scene rotation to polar coordinates?


Given a three.js scene, how does one calculate the theta and phi polar coordinates from the x, y and z position and rotation property values of a THREE.PerspectiveCamera?


Solution

  • You just need to take your x, y, and z coordinates and plug them into the following equations:

    enter image description here

    enter image description here

    enter image description here

    Source: https://en.wikipedia.org/wiki/Spherical_coordinate_system