Understanding matrix operations

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Understanding matrix operations

Post by Genete »

From the Moho Scripting reference:
void Rotate(axis, angle)

Prepend a rotation onto the current matrix.
axis (int): the angle (in radians) to rotate about (axis constants can be found here)
angle (float): the angle (in radians) to rotate the vector Return value: none
axis is an integer and represents a constant (although it says it is an angle...) . Here the constants.

Code: Select all

X_AXIS - Positive X axis
Y_AXIS - Positive Y axis
Z_AXIS - Positive Z axis
NEGX_AXIS - Negative X axis
NEGY_AXIS - Negative Y axis
NEGZ_AXIS - Negative Z axis
FREE_AXIS - Arbitrary free axis
What is the value to FREE_AXIS? How to tell to the matrix what is the axis I want to prepend a rotation?

Maybe it could admit a 3D vector in that parameter?
Have someone any idea of how to build a matrix with a rotation in an arbitrary axis?
-G
Post Reply