Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Angles to Coordinates

edited June 2013 in Questions Posts: 1,976

So I'm working on a small 3-D game, mainly for learning 3-D rendering techniques, and I've ran across a problem with the controls: I want to be able to turn to a different angle, and when I walk forwards walk into that angle. I can get the offsets (can be negative) of the movement controls and looking controls, and I know which direction I'm looking in, but all my attempts to make movement relative to the direction you're facing have failed. I have an idea, using math.atan2 to calculate the direction you're looking at in radians, do the same for the direction of the movement controls, add them together and calculate the movement from that. So that's my question. How can I convert an angle in radians (or degrees) into 3-D coordinates, to tell the offset I should give the camera?

Comments

Sign In or Register to comment.