I'm making a game where the players are on a sphere world and can walk around as one would expect them to.
The problem I'm having is finding out the position on the sphere the players would go to when they step forwards/backwards or strafe.
Essentially I need to calculate relative azimuth and inclination angles of a point in the direction the player is looking.
I've had a few ideas but I've hit dead ends on each.
If you could help me out or let me know what the relevant equations are that would be super.
At the moment I calculate a 'look at' point based on an x-angle and y-angle that increases or decreases when the player moves the mouse. The 'look at' point is found by putting an imaginary sphere around the player and using the x and y angles as azimuth and inclination with an arbitrary radius. (described well on this wiki page.)
lookX = 10 * sin(YAng) * cos(XAng); lookY = 10 * cos(YAng); lookZ = 10 * sin(YAng) * sin(XAng);
One idea I had for forward motion is to imagine a line from the center of the planet to the 'look at' point (with a radius proportional to walking speed) and check when it intercepts the spheres surface.
For that approach I couldn't find out how to find the intercept point of the line, I imagine it shouldn't be too hard because the sphere has a set radius.
Any guidance would be much appreciated.