Is there a utility for converting Spherical coords to Cartesian

Is there a utility to convert the spherical coordinates (like ones coming from navigator.geolocation) to cartesian coordinates to use them to position a camera or objects in a three.js scene?

I saw Spherical in docs for converting bu not vice versa.

Alternatively, is it possible to use spherical coordinates directly to set position of objects in a scene? AFAIK, three.js uses only cartesian coordinates to set the objects’ positions in a scene.

THREE.Vector3.setFromSpherical
https://threejs.org/docs/#api/en/math/Vector3.setFromSpherical

And the next one, THREE.Vector3.setFromSphericalCoords

4 Likes