Sign in to follow this  
3TATUK2

3D X/Y/Z Mouse/Movements

Recommended Posts

I'm having some trouble with 3D math... I'm writing a game engine and implementing mouse/movements... I have X/Y/Z variables which work as follows: -X moves things to the left, +X to the right, -Y down, +Y up, -Z in, +Z out... My current key codes are here: [url="http://bpaste.net/raw/ZaIPvc9RT7QabnUpQclC/"]http://bpaste.net/raw/ZaIPvc9RT7QabnUpQclC/[/url] ... Now, LEFT/RIGHT(horizontal strafe) work perfectly, the problem is with UP/DOWN(forward/back)... It works 'some' of the time, until, for example... I'm at the top of the scene looking straight down (with a self.x_axis_rotation of 90) and I press forward... it moves on a *diagonal* downward instead of *straight* down as expected... I think something is wrong/missing related to how I update self.z and possibly self.x_axis_rotation .. Any clues?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this