Vuo
1.2.8
|
A 3D transformation (scale, rotation, translation).
Classes | |
struct | VuoTransform |
A 3D transformation (scale, rotation, translation). More... | |
union | VuoTransform.rotationSource |
struct | VuoTransform.rotationSource.__unnamed__ |
Enumerations | |
enum | VuoTransformType { VuoTransformTypeEuler, VuoTransformTypeQuaternion, VuoTransformTypeTargeted } |
The type of rotation description used to construct this transform. More... | |
Functions | |
void | VuoTransform_getMatrix (const VuoTransform value, float *matrix) |
Converts value into a column-major matrix of 16 values, composed as a rotation followed by a scale followed by a translation. More... | |
VuoPoint3d | VuoTransform_getDirection (const VuoTransform transform) |
Start with an object pointing rightward (increasing X axis). More... | |
VuoTransform | VuoTransform_makeIdentity (void) |
Creates a VuoTransform with no effect. More... | |
VuoTransform | VuoTransform_makeEuler (VuoPoint3d translation, VuoPoint3d rotation, VuoPoint3d scale) |
Creates a VuoTransform from translation, rotation (Euler angles, in radians), and scale values. More... | |
VuoTransform | VuoTransform_makeQuaternion (VuoPoint3d translation, VuoPoint4d rotation, VuoPoint3d scale) |
Creates a VuoTransform from translation, rotation (quaternion), and scale values. More... | |
VuoTransform | VuoTransform_makeFromJson (json_object *js) |
Decodes the JSON object js to create a new value. More... | |
json_object * | VuoTransform_getJson (const VuoTransform value) |
Encodes value as a JSON object. More... | |
char * | VuoTransform_getSummary (const VuoTransform value) |
Produces a brief human-readable summary of value . More... | |
void | VuoTransform_getBillboardMatrix (VuoInteger imageWidth, VuoInteger imageHeight, VuoReal imageScaleFactor, VuoBoolean preservePhysicalSize, VuoReal translationX, VuoReal translationY, VuoInteger viewportWidth, VuoInteger viewportHeight, VuoReal backingScaleFactor, VuoReal meshX, float *billboardMatrix) |
Returns a column-major matrix of 16 values that transforms a 1x1 quad so that it renders the specified image at real (pixel-perfect) size. More... | |
VuoPoint3d | VuoTransform_getEuler (const VuoTransform transform) |
Returns the transform's rotation, represented as euler angles in radians (see VuoTransform_makeEuler). More... | |
VuoPoint4d | VuoTransform_getQuaternion (const VuoTransform transform) |
Returns the transform's rotation, represented as a quaternion (see VuoTransform_makeQuaternion). More... | |
void | VuoTransform_rotationMatrixFromQuaternion (const VuoPoint4d quaternion, float *matrix) |
Populate a 3x3 matrix with a normalized quaternion. More... | |
void | VuoTransform_rotationMatrixFromEuler (const VuoPoint3d euler, float *matrix) |
Populate a 3x3 matrix with an euler rotation. More... | |
VuoTransform | VuoTransform_makeFrom2d (VuoTransform2d transform2d) |
Creates a 3D transform from a 2D transform. More... | |
VuoTransform2d | VuoTransform_get2d (VuoTransform transform) |
Creates a 2D transform from a 3D transform. More... | |
VuoTransform | VuoTransform_makeFromTarget (VuoPoint3d position, VuoPoint3d target, VuoPoint3d upDirection) |
Create a transform that translates to position and looks at target with roll determined by upDirection . More... | |
VuoTransform | VuoTransform_makeFromMatrix4x4 (const float *matrix) |
Creates a transform from the specified matrix (assumed to consist of affine rotation, scale, and translation). More... | |
VuoTransform | VuoTransform_composite (const VuoTransform a, const VuoTransform b) |
Returns a composite transformation, consisting of a followed by b . More... | |
static VuoPoint4d | VuoTransform_quaternionComposite (VuoPoint4d a, VuoPoint4d b) __attribute__((const)) |
Returns the composite of quaternion a with quaternion b (i.e., the rotation described by a followed by the rotation described by b ). More... | |
static VuoPoint4d | VuoTransform_quaternionFromAxisAngle (VuoPoint3d axis, float angle) __attribute__((const)) |
Returns the quaternion describing the rotation of angle radians about axis . More... | |
VuoPoint4d | VuoTransform_quaternionFromBasis (VuoPoint3d basis[3]) |
Returns a quaternion representing the rotation of the specified basis matrix. More... | |
static VuoPoint4d | VuoTransform_quaternionFromVectors (VuoPoint3d from, VuoPoint3d to) __attribute__((const)) |
Returns the quaternion describing the rotation from direction from to to. More... | |
static VuoPoint4d | VuoTransform_quaternionFromMatrix (const float *rotation) __attribute__((const)) |
Create a unit quaternion from a rotation matrix (3x3). More... | |
static VuoPoint4d | VuoTransform_quaternionFromEuler (const VuoPoint3d euler) __attribute__((const)) |
Convert an euler angle (radians) to a quaternion. More... | |
static VuoPoint3d | VuoTransform_eulerFromQuaternion (const VuoPoint4d quaternion) __attribute__((const)) |
Convert a quaternion to an euler angle. More... | |
static VuoPoint3d | VuoTransform_eulerFromMatrix (const float *matrix) __attribute__((const)) |
Convert a rotation matrix (3x3) to an euler angle. More... | |
static VuoPoint3d | VuoTransform_rotateVectorWithQuaternion (const VuoPoint3d v, const VuoPoint4d q) __attribute__((const)) |
Rotates 3D vector v by quaternion q . More... | |
static bool | VuoTransform_isIdentity (const VuoTransform transform) |
Returns true if the transform is an identity (i.e., causes no change). More... | |
static void | VuoTransform_multiplyMatrices4x4 (const float *a, const float *b, float *outputMatrix) |
Multiplies the specified matrices. More... | |
static void | VuoTransform_copyMatrix4x4 (const float *sourceMatrix, float *destMatrix) |
Copies sourceMatrix to destMatrix . More... | |
static void | VuoTransform_printMatrix4x4 (const float *matrix) |
Prints the specified column-major matrix. More... | |
void | VuoTransform_invertMatrix4x4 (const float *matrix, float *outputInvertedMatrix) |
Outputs the inverse of matrix (which is assumed to consist of a rotation followed by a scale followed by a translation, like the output of VuoTransform_getMatrix), such that outputInvertedMatrix * matrix = identityMatrix . More... | |
static VuoPoint3d | VuoTransform_transformPoint (const float *matrix, VuoPoint3d point) |
Transforms point using matrix (a column-major matrix of 16 values), and returns the new point. More... | |
static VuoPoint3d | VuoTransform_transformVector (const float *matrix, VuoPoint3d point) |
Transforms vector using matrix (a column-major matrix of 16 values), and returns the new vector. More... | |
VuoRectangle | VuoTransform_transformRectangle (const float *matrix, VuoRectangle rectangle) |
Transforms rectangle using matrix (a column-major matrix of 16 values), and returns the new rectangle. More... | |
VuoTransform | VuoTransform_makeFromString (const char *str) |
Automatically generated function. More... | |
char * | VuoTransform_getString (const VuoTransform value) |
Automatically generated function. More... | |
void | VuoTransform_retain (VuoTransform value) |
Automatically generated function. More... | |
void | VuoTransform_release (VuoTransform value) |
Automatically generated function. More... | |
struct VuoTransform |
Class Members | ||
---|---|---|
float | rotation[9] | Column-major 3x3 matrix. |
union VuoTransform | rotationSource | |
VuoPoint3d | scale | |
VuoPoint3d | translation | |
enum VuoTransformType | type |
union VuoTransform.rotationSource |
Class Members | ||
---|---|---|
rotationSource | __unnamed__ | |
VuoPoint3d | euler | Radians. |
VuoPoint4d | quaternion |
struct VuoTransform.rotationSource.__unnamed__ |
Class Members | ||
---|---|---|
VuoPoint3d | target | |
VuoPoint3d | upDirection |
enum VuoTransformType |
The type of rotation description used to construct this transform.
VuoTransform VuoTransform_composite | ( | const VuoTransform | a, |
const VuoTransform | b | ||
) |
Returns a composite transformation, consisting of a
followed by b
.
|
inlinestatic |
Copies sourceMatrix
to destMatrix
.
|
inlinestatic |
Convert a rotation matrix (3x3) to an euler angle.
|
inlinestatic |
Convert a quaternion to an euler angle.
https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
VuoTransform2d VuoTransform_get2d | ( | VuoTransform | transform | ) |
Creates a 2D transform from a 3D transform.
void VuoTransform_getBillboardMatrix | ( | VuoInteger | imageWidth, |
VuoInteger | imageHeight, | ||
VuoReal | imageScaleFactor, | ||
VuoBoolean | preservePhysicalSize, | ||
VuoReal | translationX, | ||
VuoReal | translationY, | ||
VuoInteger | viewportWidth, | ||
VuoInteger | viewportHeight, | ||
VuoReal | backingScaleFactor, | ||
VuoReal | meshX, | ||
float * | billboardMatrix | ||
) |
Returns a column-major matrix of 16 values that transforms a 1x1 quad so that it renders the specified image at real (pixel-perfect) size.
VuoPoint3d VuoTransform_getDirection | ( | const VuoTransform | transform | ) |
Start with an object pointing rightward (increasing X axis).
This function returns a unit vector representing the direction a rightward-pointing object (+x axis) would be pointing after being transformed by transform
.
VuoPoint3d VuoTransform_getEuler | ( | const VuoTransform | transform | ) |
Returns the transform's rotation, represented as euler angles in radians (see VuoTransform_makeEuler).
struct json_object * VuoTransform_getJson | ( | const VuoTransform | value | ) |
Encodes value
as a JSON object.
void VuoTransform_getMatrix | ( | const VuoTransform | value, |
float * | matrix | ||
) |
Converts value
into a column-major matrix of 16 values, composed as a rotation followed by a scale followed by a translation.
VuoPoint4d VuoTransform_getQuaternion | ( | const VuoTransform | transform | ) |
Returns the transform's rotation, represented as a quaternion (see VuoTransform_makeQuaternion).
char* VuoTransform_getString | ( | const VuoTransform | value | ) |
Automatically generated function.
char * VuoTransform_getSummary | ( | const VuoTransform | value | ) |
Produces a brief human-readable summary of value
.
void VuoTransform_invertMatrix4x4 | ( | const float * | matrix, |
float * | outputInvertedMatrix | ||
) |
Outputs the inverse of matrix
(which is assumed to consist of a rotation followed by a scale followed by a translation, like the output of VuoTransform_getMatrix), such that outputInvertedMatrix * matrix = identityMatrix
.
|
inlinestatic |
Returns true if the transform is an identity (i.e., causes no change).
VuoTransform VuoTransform_makeEuler | ( | VuoPoint3d | translation, |
VuoPoint3d | rotation, | ||
VuoPoint3d | scale | ||
) |
Creates a VuoTransform
from translation, rotation (Euler angles, in radians), and scale values.
VuoTransform VuoTransform_makeFrom2d | ( | VuoTransform2d | transform2d | ) |
Creates a 3D transform from a 2D transform.
VuoTransform VuoTransform_makeFromJson | ( | json_object * | js | ) |
Decodes the JSON object js
to create a new value.
VuoTransform VuoTransform_makeFromMatrix4x4 | ( | const float * | matrix | ) |
Creates a transform from the specified matrix
(assumed to consist of affine rotation, scale, and translation).
VuoTransform VuoTransform_makeFromString | ( | const char * | str | ) |
Automatically generated function.
VuoTransform VuoTransform_makeFromTarget | ( | VuoPoint3d | position, |
VuoPoint3d | target, | ||
VuoPoint3d | upDirection | ||
) |
Create a transform that translates to position
and looks at target
with roll determined by upDirection
.
Similar to gluLookAt
.
VuoTransform VuoTransform_makeIdentity | ( | void | ) |
Creates a VuoTransform
with no effect.
VuoTransform VuoTransform_makeQuaternion | ( | VuoPoint3d | translation, |
VuoPoint4d | rotation, | ||
VuoPoint3d | scale | ||
) |
Creates a VuoTransform
from translation, rotation (quaternion), and scale values.
VuoPoint4d_make(0,0,0,1)
(w=1, x=y=z=0) is the rotational identity.
|
inlinestatic |
Multiplies the specified matrices.
|
inlinestatic |
Prints the specified column-major matrix.
|
inlinestatic |
Returns the composite of quaternion a
with quaternion b
(i.e., the rotation described by a
followed by the rotation described by b
).
|
inlinestatic |
Returns the quaternion describing the rotation of angle
radians about axis
.
VuoPoint4d VuoTransform_quaternionFromBasis | ( | VuoPoint3d | basis[3] | ) |
Returns a quaternion representing the rotation of the specified basis matrix.
|
inlinestatic |
Convert an euler angle (radians) to a quaternion.
https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
|
inlinestatic |
Create a unit quaternion from a rotation matrix (3x3).
|
inlinestatic |
Returns the quaternion describing the rotation from direction from to to.
If either from or to has magnitude 0, then returns the identity quaternion (no rotation).
void VuoTransform_release | ( | VuoTransform | value | ) |
Automatically generated function.
void VuoTransform_retain | ( | VuoTransform | value | ) |
Automatically generated function.
|
inlinestatic |
Rotates 3D vector v
by quaternion q
.
void VuoTransform_rotationMatrixFromEuler | ( | const VuoPoint3d | euler, |
float * | matrix | ||
) |
Populate a 3x3 matrix with an euler rotation.
Euler values are expressed in radians.
void VuoTransform_rotationMatrixFromQuaternion | ( | const VuoPoint4d | quaternion, |
float * | matrix | ||
) |
Populate a 3x3 matrix with a normalized quaternion.
|
inlinestatic |
Transforms point
using matrix
(a column-major matrix of 16 values), and returns the new point.
VuoRectangle VuoTransform_transformRectangle | ( | const float * | matrix, |
VuoRectangle | rectangle | ||
) |
Transforms rectangle
using matrix
(a column-major matrix of 16 values), and returns the new rectangle.
If the matrix specifies a rotation, this function returns an axis-aligned rectangle fully enclosing the source rectangle.
|
inlinestatic |
Transforms vector
using matrix
(a column-major matrix of 16 values), and returns the new vector.
Ignores the matrix's translation. Useful for adjusting normals.