1

Kinematic based world being messed on movement

Hello, I have been developing a humble AR-based game in Unity3d. Until this point, I have been using Vuforia to deploy my scene on a (multi)tracker. However, I have been doing tests with Kudan and I´m quite happy with its tracking performance when using a tracker.


https://i.stack.imgur.com/3xuJX.png


My engine is based on collisions by raycasts and not "UnityEngine.Physics" (Almost Everything is Kinematic). I have stumbled into a problem when I deploy my 3d environment on a tracker using the Kudan engine, my whole physics get messed up. If the marker is moved the elements move with it but the axis seem to change with marker but my physics seem to respond to my old axis orientation. My characters are always standing upward in the world Y axis (not the local inside the tracker). Another issue is that my player 3D asset keeps switching between "standing" and "falling" status and eventually clipping and falling through the floor (this is probably due to the jitter in the camera detection).


https://i.stack.imgur.com/M1GxD.png

One of the solutions that come to mind is to use a local coordinate system but I hope that there is an alternative solution since when I was using Vuforia I did not have to do any further corrections.

Any links or feedback are appreciated.

Community
  • 1
  • 1
Keny
  • 11
  • 1
  • With Kudan, the camera always stays at the origin (0,0,0) and any tracked objects move around it. It seems you'll have to switch to a local coordinate system if you want to keep using Kudan. – DisturbedNeo Dec 12 '16 at 15:34
  • Thank you. I was suspecting just that. – Keny Dec 13 '16 at 15:58

1 Answers1

1

You could use transform.InverseTransformPoint and transform.InverseTransformDirection combined with Quaternion.LookDirection to get the position and rotation of the kudan camera relative to the MarkerTransformDriver object. This will allow you to position a camera in world space and keep whatever content you want to augment static at the unity3d world origin.

cameraPos = markerTransform.InverseTransformPoint(kudanCamera.position);
cameraRot = Quaternion.LookRotation(markerTransform.InverseTransformDirection (kudanCamera.transform.forward));
notsimon
  • 11
  • 1
  • This has put me close to what I need with ARToolKit. Though, it's not exactly right. I think maybe an axis is reversed for the rotation. I've created another question here: https://stackoverflow.com/questions/45236934/artoolkit-dynamic-camera-with-single-static-marker – Sean Novak Jul 21 '17 at 13:06