Browse Source

Fix rotation correction

Johannes Kreutz 2 years ago
parent
commit
24f3f002e2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      track-client/TrackClient/Assets/TrackpointApp/SteamVRTrack.cs

+ 2 - 2
track-client/TrackClient/Assets/TrackpointApp/SteamVRTrack.cs

@@ -45,8 +45,8 @@ public class SteamVRTrack : TrackpointMesh
         trackpointMesh.transform.localPosition = new Vector3(-(point[0] / divisor), -(point[1] / divisor), -(point[2] / divisor));
         Vector3 unityNormal = new Vector3(normal[0], normal[2], normal[1]);
         Quaternion rotateObjectToTrackpoint = Quaternion.FromToRotation(Vector3.up, unityNormal); 
-        Quaternion correction = Quaternion.AngleAxis(rotationCorrection, Vector3.up);
-        Quaternion result = rotateObjectToTrackpoint * correction;
+        Quaternion correction = Quaternion.AngleAxis(rotationCorrection, Vector3.back);
+        Quaternion result = correction * rotateObjectToTrackpoint;
         rotationObject.transform.rotation = result;
     }
 }