Skip to content

Commit

Permalink
fix directions of rotations and translations
Browse files Browse the repository at this point in the history
  • Loading branch information
henrykrumb committed Aug 3, 2023
1 parent 2e31b54 commit 728f834
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/spnavigt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ int main(int argc, char *argv[])
{
if (sev.type == SPNAV_EVENT_MOTION)
{
T.set(0, 3, T.get(0, 3) + (float)-sev.motion.x * sensitivity);
T.set(2, 3, T.get(2, 3) + (float)sev.motion.y * sensitivity);
T.set(1, 3, T.get(1, 3) + (float)-sev.motion.z * sensitivity);
T.set(0, 3, T.get(0, 3) - (float)-sev.motion.x * sensitivity);
T.set(2, 3, T.get(2, 3) - (float)sev.motion.y * sensitivity);
T.set(1, 3, T.get(1, 3) - (float)-sev.motion.z * sensitivity);

ax += sev.motion.rx * sensitivity;
ay += sev.motion.ry * sensitivity;
ay -= sev.motion.ry * sensitivity;
az += sev.motion.rz * sensitivity;

printf("got motion event: t(%d, %d, %d) ", sev.motion.x, sev.motion.y, sev.motion.z);
Expand Down

0 comments on commit 728f834

Please sign in to comment.