What I really needed was a way to translate a polar/spherical coordinates into cartesian coordinates.
In other words, I have two angles and one radius and a need to convert it into a Vector3/XYZ.
Here is the code:
function polarToCartesian( angleV, angleH, radius ) {
var phi = ( 90 - angleV ) * DEG2RAD
var theta = ( angleH + 180 ) * DEG2RAD
return {
x: -(radius * Math.sin(phi) * Math.sin(theta)),
y: radius * Math.cos(phi),
z: radius * Math.sin(phi) * Math.cos(theta),
}
}
Source: https://gist.github.com/jhermsmeier/72626d5fd79c5875248fd2c1e8162489