I’ve setup the CylinderTarget AR tracking sample from the Vuforia website and it’s tracking a Coke can well.
I’m trying to use the rotation of of the tracked can to control other aspects of my game.
When the can is pointing up, reading the rotation around the Y axis gives the expected result. however reading the y rotation once the cylinder is rotated into other directions by the tracking system messes everything up.
I’ve tried reading from a few different rotation values, eulerAngles.y, localEulerAngles.y, localRotation.y and just rotation.y but none seem to give me just the rotation around the local y axis.
When I spin the physical can on its Y axis, the other rotation values (Z and X) always change wildly too.
I know this could seem to be more of a Vuforia topic than Unity but I think I’m just missing something fundamental about Unity rotation transforms.
what I’m I getting wrong??
thanks.
I[33208-screen+shot+2014-10-02+at+14.36.06.png|33208]
(I’ve set the ARCamera to World Centre Mode to CAMERA so that the Cylinder is the thing that moves not the camera.)
Not a lot of experience with Vuforia, but Vuiforia rotates the camera, not objects, so your object is not rotating unless you are writing code that explicitly rotates it.
– robertbuI found a setting in Vuforia to rotate the object instead. - it's the World Centre Mode setting I mentioned above.
– digitalbath