Editing
Appendix/Ramblings/VirtualReality
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Understanding the Positioning Matrix==== Evidently, the COLLADA language allows you to reposition an object — for example, one of the cubes in this trio — (a) by explicitly specifying the separate instructions to <translate>, <rotate>, and <scale>; or (b) by specifying, in the form of a 4×4 <matrix>, a single instruction that combines all of the others via matrix multiplication. For example, in COLLADA the instruction, '''<scale>S<sub>x</sub> S<sub>y</sub> S<sub>z</sub></scale>''', is equivalent to, <table border="0" align="center" cellpadding="8"> <tr> <td align="right" rowspan="1"><b>M</b><sub>scale</sub> = </td> <td align="left"> <table border="1" cellpadding="8"> <tr> <td align="center">S<sub>x</sub></td> <td align="center">0</td> <td align="center">0</td> </tr> <tr> <td align="center">0</td> <td align="center">S<sub>y</sub></td> <td align="center">0</td> </tr> <tr> <td align="center">0</td> <td align="center">0</td> <td align="center">S<sub>z</sub></td> </tr> </table> </td> </tr> </table> And, drawing from the [https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations Wikipedia discussion of ''Basic Rotations''] in three dimensions, we recognize that rotations about the x, y, and z axes are quantitatively defined, respectively, by the following matrices: <table border="0" align="center" cellpadding="8"> <tr> <td align="right" rowspan="1"><b>R</b><sub>x</sub>(α) = </td> <td align="left"> <table border="1" cellpadding="8"> <tr> <td align="center">1</td> <td align="center">0</td> <td align="center">0</td> </tr> <tr> <td align="center">0</td> <td align="center">cos(α)</td> <td align="center">- sin(α)</td> </tr> <tr> <td align="center">0</td> <td align="center">sin(α)</td> <td align="center">cos(α)</td> </tr> </table> </td> <td align="center"> ; <b>R</b><sub>y</sub>(β) = </td> <td align="left"> <table border="1" cellpadding="8"> <tr> <td align="center">cos(β)</td> <td align="center">0</td> <td align="center">sin(β)</td> </tr> <tr> <td align="center">0</td> <td align="center">1</td> <td align="center">0</td> </tr> <tr> <td align="center">-sin(β)</td> <td align="center">0</td> <td align="center">cos(β)</td> </tr> </table> </td> <td align="center"> ; <b>R</b><sub>z</sub>(γ) = </td> <td align="left"> <table border="1" cellpadding="8"> <tr> <td align="center">cos(γ)</td> <td align="center">- sin(γ)</td> <td align="center">0</td> </tr> <tr> <td align="center">sin(γ)</td> <td align="center">cos(γ)</td> <td align="center">0</td> </tr> <tr> <td align="center">0</td> <td align="center">0</td> <td align="center">1</td> </tr> </table> </td> </tr> </table> The equivalent instructions in COLLADA are, respectively, <table border="0" align="center" cellpadding="8"> <tr> <td align="left"> '''<rotate> 1 0 0 α </rotate>''' ; </td> <td align="left"> '''<rotate> 0 1 0 β </rotate>''' ; </td> <td align="left"> '''<rotate> 0 0 1 γ </rotate>''' . </td> </tr> </table> Drawing furthermore from the [https://en.wikipedia.org/wiki/Rotation_matrix#General_rotations Wikipedia discussion of more ''General Rotations''], we recognize that other rotation matrices can be obtained from these three using matrix multiplications. For example, the product <div align="center"> <math>~R(\alpha,\beta,\gamma) = R_z(\alpha) \times R_y(\beta) \times R_x(\gamma) \, ,</math> </div> — a 3×3 matrix — represents a rotation whose ''yaw'', ''pitch'', and ''roll'' angles are α, β, and γ, respectively. Finally, including possible translations T<sub>x</sub>, T<sub>y</sub>, and T<sub>z</sub> in the x, y, and z directions, respectively, we can write <table border="0" align="center" cellpadding="8"> <tr> <td align="center"> <table border="1" align="center" cellpadding="8"> <tr> <td align="center">x'</td> </tr> <tr> <td align="center">y'</td> </tr> <tr> <td align="center">z'</td> </tr> </table> </td> <td align="right" rowspan="1"> = </td> <td align="center"> <table border="1" align="center" cellpadding="8"> <tr> <td align="center">T_x</td> </tr> <tr> <td align="center">T_y</td> </tr> <tr> <td align="center">T_z</td> </tr> </table> </td> <td align="right" rowspan="1"> + </td> <td align="left"> <table border="1" align="center" cellpadding="2"><tr><td align="left"> <table border="0" cellpadding="8"> <tr><td align="center"> </td></tr> <tr> <td align="center">R(α, β, γ) × M<sub>scale</sub><br />'''[3×3 matrix]'''</td> </tr> <tr><td align="center"> </td></tr> </table> </td></tr></table> </td> <td align="right" rowspan="1"> × </td> <td align="center"> <table border="1" align="center" cellpadding="8"> <tr> <td align="center">x</td> </tr> <tr> <td align="center">y</td> </tr> <tr> <td align="center">z</td> </tr> </table> </td> </tr> </table> or, equivalently (I ''think'' this is correct!), <table border="0" align="center" cellpadding="8"> <tr> <td align="center"> <table border="1" align="center" cellpadding="8"> <tr> <td align="center">x'</td> </tr> <tr> <td align="center">y'</td> </tr> <tr> <td align="center">z'</td> </tr> <tr> <td align="center">1</td> </tr> </table> </td> <td align="right" rowspan="1"> = </td> <td align="left"> <table border="1" cellpadding="8"> <tr> <td align="center" colspan="3" rowspan="3">R(α, β, γ) × M<sub>scale</sub></td> <td align="center">T<sub>x</sub></td> </tr> <tr> <td align="center">T<sub>y</sub></td> </tr> <tr> <td align="center">T<sub>z</sub></td> </tr> <tr> <td align="center">0</td> <td align="center">0</td> <td align="center">0</td> <td align="center">1</td> </tr> </table> </td> <td align="right" rowspan="1"> × </td> <td align="center"> <table border="1" align="center" cellpadding="8"> <tr> <td align="center">x</td> </tr> <tr> <td align="center">y</td> </tr> <tr> <td align="center">z</td> </tr> <tr> <td align="center">1</td> </tr> </table> </td> </tr> </table>
Summary:
Please note that all contributions to JETohlineWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JETohlineWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Tiled Menu
Table of Contents
Old (VisTrails) Cover
Appendices
Variables & Parameters
Key Equations
Special Functions
Permissions
Formats
References
lsuPhys
Ramblings
Uploaded Images
Originals
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information