note: I know my issue is more of a mathematical problem than a threejs problem, but I would appreciate the help.
I have this sphere, the blue pins were placed by rotation only (the center is at 0,0,0 and I just rotate along the Y-axis and the Z-axis), the pin (p1) starts at rotation (y=0, z=0), the angles between them are 45 degree. The red spheres are placed using location (XYZ ) the issue is here.
As you can see the sphere of p4 is misplaced, I’m using this method for converting rotation to coordinates:
const rad = Math.PI / 180;
const lat = 45 * rad; // here I change the angle from 45 to what ever I want
const lon = 45 * rad; // same here
// 5 is the radius
const x_ = 5 * Math.cos(lat) * Math.cos(lon);
const y_ = 5 * Math.cos(lat) * Math.sin(lon);
const z_ = 5 * Math.sin(lat);
//is this method correct?
@prisoner849 ok, so Spherical uses the Spherical coordinate system. to be honest, I have no idea how this can help me … I went through the documentation and I didn’t see anything useful! Am I missing something? can it returns XYZ coordinate?
I managed to resolve the manual calculation of coordinates (with sin and cos). However, the exact formula set for conversion from spherical to Cartesian coordinates depends on how axes are chosen. So, @Asfan, could draw how your X, Y and Z axes are, as well as what are your lat and lon angles (where is their 0 and what is their positive direction).
I tried to use your orientation of axes. In order to fix the positions, I had to replace Y and Z coordinates of the points. See lines 91-92. This is because in Three.js (by default) the Y axis points up.