ROTATE MATRIX: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
New page: {{Command|syntax=ROTATE_MATRIX <matrix array>, <vx>, <vy>, <vz> |description=*DESCRPTION* |param1=<matrix array>|param1_desc= |param2=<vx>|param2_desc= |param3=<vy>|param3_desc= |param4=<... |
No edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | [[:Category:Matrices|{{Up}}]] | ||
|param1=<matrix array>|param1_desc= | {{Command|syntax=ROTATE_MATRIX <matrix array>, <vx>, <vy>, <vz>, <angle> | ||
|param2=<vx>|param2_desc= | |description=:Modify a matrix by applying a rotation. | ||
|param3=<vy>|param3_desc= | |||
|param4=<vz>|param4_desc= | |param1=<matrix array>|param1_desc={{parameter_variable_matrix}} | ||
|param2=<vx>|param2_desc={{vx}} | |||
|param3=<vy>|param3_desc={{vy}} | |||
|param4=<vz>|param4_desc={{vz}} | |||
|param5=<angle>|param5_desc={{angle}} | |||
}} | }} | ||
===Example=== | ===Example=== | ||
: | :GLOBAL Matrix1(12) | ||
<br> | |||
:DEGREES | |||
:GET_SCALE_MATRIX Matrix1, 0.25 | |||
:ROTATE_MATRIX Matrix1, 0, 0, 1, 45 | |||
<br> | |||
:This will get a matrix to scale to 1/4 size, then rotate around the Z axis by 45 degrees. | |||
[[Category:Matrices]] | [[Category:Matrices]] | ||
Latest revision as of 18:26, 12 January 2011
Command
- ROTATE_MATRIX <matrix array>, <vx>, <vy>, <vz>, <angle>
- Modify a matrix by applying a rotation.
Parameters
- <matrix array>
- Name of Matrix variable
- <vx>
- the X component of a vector.
- <vy>
- the Y component of a vector.
- <vz>
- the Z component of a vector.
- <angle>
- angle value, either degrees or radians. Positive angles indicate a CCW direction, negative for CW.
Use the DEGREES or RADIANS commands to switch between the two angle modes.
Example
- GLOBAL Matrix1(12)
- DEGREES
- GET_SCALE_MATRIX Matrix1, 0.25
- ROTATE_MATRIX Matrix1, 0, 0, 1, 45
- This will get a matrix to scale to 1/4 size, then rotate around the Z axis by 45 degrees.