I am trying to find a point in three-dimensional space relative to the origin (0,0,0). I have 3 values for calculating this point with: rotation in degrees both on the x axis and on the y axis, as well as the "distance of view". Using these values, how can I find a point in three-dimensional space relative to the origin? I tried using basic trigonometric functions, but the results seem random. The image below gives a visual idea of what needs to be done.

- 'vd' is the "viewing distance"
- 'c' is a value holder
- '(x, y, z)' - the coordinate I'm trying to find
What I'm trying to do is find the point at which the player is looking at a certain distance (find the point in the player’s line of sight at a certain distance). Keep in mind that the rotation around the x and y axis is constantly changing, but the viewing distance remains unchanged. If someone has any suggestions, methods on how to do this, or clarification is required, comment / answer below.
I am doing this in LWJGL, and the code I use is as follows:
float c = (float)(Math.cos(Math.toRadians(A00.rot.y)) * view_distance); locate.y = (float)(Math.sin(Math.toRadians(rot.y)) * view_distance); locate.x = (float)(Math.cos(Math.toRadians(rot.x)) * c); locate.z = (float)(Math.sin(Math.toRadians(rot.x)) * c);
EDIT:
My problem is that this current installation does NOT work for some reason. Mathematics seems legal to me, but I have to do something wrong in the actual schedule setup.
source share