48
edits
No edit summary |
No edit summary |
||
Line 32: | Line 32: | ||
We might need to convert rotation matrix to quaternion depend on your project needs after we get data from theCaptury in matrix format.There i present two ways to convert there two. | We might need to convert rotation matrix to quaternion depend on your project needs after we get data from theCaptury in matrix format.There i present two ways to convert there two. | ||
Convert quaternion to 4×4 Rotation matrix.<br> | *Convert quaternion to 4×4 Rotation matrix.<br> | ||
<source lang="csharp"> | <source lang="csharp"> | ||
Quaternion q = Quaternion.LookRotation(new Vector3(0,0.5,1)); | Quaternion q = Quaternion.LookRotation(new Vector3(0,0.5,1)); | ||
Line 39: | Line 39: | ||
</source> | </source> | ||
Convert 4×4 Rotation matrix to quaternion.<br> | *Convert 4×4 Rotation matrix to quaternion.<br> | ||
<source lang="csharp"> | <source lang="csharp"> | ||
Matrix4x4 rot = new Matrix4x4(); | Matrix4x4 rot = new Matrix4x4(); | ||
Line 47: | Line 47: | ||
Quaternion newQ = Quaternion.LookRotation(new Vector3(vz.x,vz.y,vz.z),new Vector3(vy.x,vy.y,vy.z)); | Quaternion newQ = Quaternion.LookRotation(new Vector3(vz.x,vz.y,vz.z),new Vector3(vy.x,vy.y,vy.z)); | ||
</source> | </source> | ||
*Other conversion | |||
[http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm Euler to Quaternion]<br> | |||
[http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm Quaternion To Euler]<br> | |||
[http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm AngleAxis to Quaternion]<br> | |||
[http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm Quaternion to AngleAxis]<br> | |||
== Cover the OSC syntax and how to get nodes as matrix / vector, absolute and relative == | == Cover the OSC syntax and how to get nodes as matrix / vector, absolute and relative == | ||
Line 74: | Line 80: | ||
<br style=“clear:both”> | <br style=“clear:both”> | ||
You can use transform.localPosition to get position of the transform relative to the parent transform. | *You can use transform.localPosition to get position of the transform relative to the parent transform. | ||
== How to create objects in Unity and arrange them so they represent the nodes == | == How to create objects in Unity and arrange them so they represent the nodes == |
edits