Skip to content

Keyboard and mouse uses inconsistent coordinate systems, resulting in incorrect movement #447

Description

@jkinz3

If you follow the keyboard and mouse tutorial and implement a basic first person camera, the movement is incorrect.
move

In this provided GIF, you can see that as i'm looking down while pressing E to move up (locally), it begins to move be down (locally). And when I press W to move forward (locally) it moves me backwards (locally).
I narrowed it down to the trigonometry calculations used to create the lookAt vector. It appears to assume that forward is +Z. This is inconsistent with the quaternion transform function used to rotate the input vector, which follows SimpleMaths convention of forward being -Z.
Looks like that tutorial needs the trig calculations rewritten and unfortunately i'm not mathy enough to know what needs to be changed and submit a pull request for it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions