48
edits
No edit summary |
No edit summary |
||
Line 33: | Line 33: | ||
Convert quaternion to 4×4 Rotation matrix.<br> | Convert quaternion to 4×4 Rotation matrix.<br> | ||
<source lang=" | <source lang="csharp"> | ||
Quaternion q = Quaternion.LookRotation(new Vector3(0,0.5,1)); | Quaternion q = Quaternion.LookRotation(new Vector3(0,0.5,1)); | ||
Matrix4x4 rot = new Matrix4x4(); | Matrix4x4 rot = new Matrix4x4(); | ||
Line 40: | Line 40: | ||
Convert 4×4 Rotation matrix to quaternion.<br> | Convert 4×4 Rotation matrix to quaternion.<br> | ||
<source lang=" | <source lang="csharp"> | ||
Matrix4x4 rot = new Matrix4x4(); | Matrix4x4 rot = new Matrix4x4(); | ||
rot.SetTRS(new Vector3(0,0,0),q,new Vector3(1,1,1)); //It’s the same “q” that mentioned above | rot.SetTRS(new Vector3(0,0,0),q,new Vector3(1,1,1)); //It’s the same “q” that mentioned above |
edits