Matrix In

https://user-images.githubusercontent.com/14288520/189546077-7329965e-3c8e-40e8-8917-e54d80b0dc32.png

Functionality

This node creates homogeneous 4x4 matrices out of translation, scale and rotation components. The rotation component can be generated based on various input formats, selectable by one of the supported modes: Quaternion, Axis + Angle or Euler Angles.

Inputs

All inputs are vectorized and they will accept single or multiple values.

  • Location

  • Scale

  • Quaternion [1]

  • Axis [2]

  • Angle [2,4]

  • Angle X [3,4]

  • Angle Y [3,4]

  • Angle Z [3,4]

Notes:

  • [1] : Input is available when “Quaternion” mode is selected

  • [2] : Inputs are available when “Axis Angle” mode is selected

  • [3] : Inputs are available when “Euler Angles” mode is selected

  • [4] : The angles are in DEGREES. The Property Panel has option to set angle units as: RADIANS, DEGREES or UNITIES.

The node accepts as inputs either lists of items (vectors, numbers, quaternions), such as: [[v, v, v]], [[a, a, a]], [[q, q, q]]. in which case it would generate a set of matrices: [[m, m, m]], but it also accepts lists of lists of items, such as [[v, v], [v, v, v]], in which case it will produce a set of matrices: [[m, m], [m, m, m]].

Parameters

The Mode parameter allows to switch between “Quaternion”, “Axis Angle” and “Euler Angles”. The input sockets for the rotation are updated to reflect the selected mode.

All parameters except Mode, Angle Units and Flat Output can be given by the node or an external input.

Param

Type

Default

Description

Mode

Enum

  • Quaternion

  • Axis Angle

  • Euler Angles

Axis Angle

Specifies how the rotation component is

provided to the node as an input.

Location

Vector

(0, 0, 0)

The translation component of the matrix.

Scale

Vector

(1, 1, 1)

The scale component of the matrix.

Angle Units

Enum

  • Deg

  • Rad

  • Uni

Deg

Specifies the units for the angle values. [1]

Quaternion

Quaternion

(1, 0, 0, 0)

The rotation component given as a

quaternion. [2]

Axis

Vector

(0, 0, 1)

The axis of rotation.

Angle

Float

0.0

The rotation angle about the given rotation

axis. [4]

Euler Order

Enum

  • XYZ

  • XZY

  • YXZ

  • YZX

  • ZXY

  • ZYX

XYZ

Specifies the order of the euler angle rotations.

Angle X

Float

0.0

The angle of rotation about the X axis. [3][4]

Angle Y

Float

0.0

The angle of rotation about the Y axis. [3][4]

Angle Z

Float

0.0

The angle of rotation about the Z axis. [3][4]

NOTES:

  • [1] : The “Angle Units” parameter is available for “Axis Angle” and “Euler Angle” modes. When switching the units the angle values are converted to the selected unit. Connected angle inputs are also considered to have the selected angle units.

  • [2] : The quaternion is expected to be normalized (corresponding to a rotation matrix). If it is not normalized, the result is undefined.

  • [3] : The XYZ angle parameters are available for “Euler Angle” mode. The order of applying these rotations is given by the “Euler Order” parameter.

  • [4] : Angles are given by default in DEGREES. The Property Panel has option to set angle units as: RADIANS, DEGREES or UNITIES.

Extra Parameters

A set of extra parameters are available on the property panel. These parameters do not receive external input.

Extra Param

Type

Default

Description

Flat Output

Bool

True

Flattens the matrix output [3] [4]

Angle Units

Enum

  • RADIANS

  • DEGREES

  • UNITIES

DEGREES

Interprets the angle values based on

the selected angle units:

  • Radians = 0.0 - 2pi

  • Degrees = 0.0 - 360.0

  • Unities = 0.0 - 1.0

NOTES:

Outputs

Matrices The output is a list of one or multiple 4x4 homogeneous matrices, based on the given input.

All outputs will be generated only when output socket is connected.

Example of usage

https://user-images.githubusercontent.com/14288520/189546149-4a603282-7346-48d5-9491-5a043eac51dc.png https://user-images.githubusercontent.com/14288520/189546359-8f061a85-72aa-44bf-8dde-70c386cace6c.gif