Version 0.58.2

atrafo

Constructor of a general affine transformation of type atrafo.

Signatures

  •   atrafo( matrix mat )

Details

The atrafo constructor creates an affine transformation from a given 3x4 matrix. Affine transformations are a type of transformation that includes translation, rotation, scaling, and their combinations, while preserving points, straight lines, and planes. This constructor allows for the definition of more complex transformations that may not be directly achievable through the basic constructors for translation, rotation, and scaling.

The matrix parameter should be a 3x4 matrix where the first three columns define the linear transformation and the last column defines the translation component.

Example

 make atrafo( <[<[ 1.0, 0.5, 0.0, 3.0 ]>,
                <[ 0.0, 1.0, 0.0, -2.0 ]>,
                <[ 0.0, 0.0, 1.0, 5.0 ]>]> ) >> mesh("bunny.stl")
 

Applies a shearing transformation along the X-axis combined with a translation of 3 units along the X-axis, -2 units along the Y-axis, and 5 units along the Z-axis to the Stanford bunny model.

Parameters

mat

A 3x4 matrix representing the affine transformation.

See also

🗙

Search results for