I know there are many 3D rotation questions that have been answered, but they all seem to be dealing with rotational matrices and quaternions in OpenGL (and I don't care if I get a cardan lock). I need to get the 3d coordinates of EX: (x, y, z) of the point, which should always be the same distance, let's call it ādā at the moment, from the origin. The only information I have as input is the deltax and mouse delta on the screen. So far I have tried:
At first:
thetaxz+=(omousex-mouseX)/( width ); thetaxy+=(omousey-mouseY)/( height);
(thetaxy is the angle in radians along the x, y axis and taxz on the x, z axis) (I limit both angles so that if they are less than or equal to 0, they are equal to 2 * PI)
Secondly:
pointX=cos(thetaxz)*d; pointY=sin(thetaxy)*d;
(point X is the coordinate of point x, and point Y is y)
Third:
if(thetaxz)<PI){ pointZ=sqrt(sq(d)-sq(eyeX/d)-sq(eyeY/d)); }else{ pointZ=-sqrt(abs(sq(d)-sq(eyeX/d)-sq(eyeY/d))); }
(sq () is a function that is quadratic, and abs () is a function of absolute value) (the point Z must be the coordinate of the point z, and it does not intersect between the positive hemisphere z and the negative z-hemisphere. As you approach the edge, the point stretches farther than the distance by which it should always be in x and y and, apparently, randomly around 0.1-0.2 radiant, the z coordinate becomes NAN or undefined)
I thought about this for a while, and, frankly, I had difficulty deforming my head around the concept of quaternions and rotational matrices, however, if you can show me how to use them to generate actual coordinates, I would be happy to know. I would prefer it if I could just use some trigonometry on several axes. Thank you in advance for any help, and if you need more information, just ask.
Hint / last minute idea: I think this may have something to do with the z position, affecting the x and y positions, but I'm not sure.
EDIT: I drew a diagram: