Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#447 11 comments 0 reactions 1 assignee View on GitHub

@walbourn is already working on this.

Since Aug 16, 2024.

Assessment

This issue has not been assessed yet.

Description

documentation

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.

Dominant language
C++
Stars
2.9k
Forks
537
Avg merge
2d 21h
Merged PRs (30d)
6

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/DirectXTK

All issues in microsoft/DirectXTK

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.