Vuo  0.7.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Enumerations | Functions
VuoTransform

Description

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.
 
VuoPoint3d VuoTransform_getDirection (const VuoTransform transform)
 Start with an object pointing rightward (increasing X axis).
 
VuoTransform VuoTransform_makeIdentity (void)
 Creates a VuoTransform with no effect.
 
VuoTransform VuoTransform_makeEuler (VuoPoint3d translation, VuoPoint3d rotation, VuoPoint3d scale)
 Creates a VuoTransform from translation, rotation (Euler angles, in radians), and scale values.
 
VuoTransform VuoTransform_makeQuaternion (VuoPoint3d translation, VuoPoint4d rotation, VuoPoint3d scale)
 Creates a VuoTransform from translation, rotation (quaternion), and scale values.
 
VuoPoint3d VuoTransform_transformPoint (const float *matrix, VuoPoint3d point)
 Transforms point using matrix (a column-major matrix of 16 values), and returns the new point.
 
VuoTransform VuoTransform_valueFromJson (json_object *js)
 Decodes the JSON object js to create a new value.
 
json_object * VuoTransform_jsonFromValue (const VuoTransform value)
 Encodes value as a JSON object.
 
char * VuoTransform_summaryFromValue (const VuoTransform value)
 Produces a brief human-readable summary of value.
 
void VuoTransform_getBillboardMatrix (VuoInteger imageWidth, VuoInteger imageHeight, VuoReal translationX, VuoReal translationY, VuoInteger viewportWidth, VuoInteger viewportHeight, 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.
 
VuoTransform VuoTransform_makeFrom2d (VuoTransform2d transform2d)
 Creates a 3D transform from a 2D transform.
 
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.
 
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).
 
static VuoPoint4d VuoTransform_quaternionFromAxisAngle (VuoPoint3d axis, float angle) __attribute__((const ))
 Returns the quaternion describing the rotation of angle radians about axis.
 
static VuoPoint4d VuoTransform_quaternionFromVectors (VuoPoint3d from, VuoPoint3d to) __attribute__((const ))
 Returns the quaternion describing the rotation from direction a to b.
 
static bool VuoTransform_isIdentity (const VuoTransform transform)
 Returns true if the transform is an identity (i.e., causes no change).
 
static void VuoTransform_multiplyMatrices4x4 (const float *a, const float *b, float *outputMatrix)
 Multiplies the specified matrices.
 
static void VuoTransform_copyMatrix4x4 (const float *sourceMatrix, float *destMatrix)
 Copies sourceMatrix to destMatrix.
 
static void VuoTransform_printMatrix4x4 (const float *matrix)
 Prints the specified column-major matrix.
 
VuoRectangle VuoTransform_transformRectangle (const float *matrix, VuoRectangle rectangle)
 Transforms rectangle using matrix (a column-major matrix of 16 values), and returns the new rectangle.
 
VuoTransform VuoTransform_valueFromString (const char *str)
 Automatically generated function.
 
char * VuoTransform_stringFromValue (const VuoTransform value)
 Automatically generated function.
 

Class Documentation

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

Enumeration Type Documentation

The type of rotation description used to construct this transform.

Function Documentation

static void VuoTransform_copyMatrix4x4 ( const float *  sourceMatrix,
float *  destMatrix 
)
inlinestatic

Copies sourceMatrix to destMatrix.

void VuoTransform_getBillboardMatrix ( VuoInteger  imageWidth,
VuoInteger  imageHeight,
VuoReal  translationX,
VuoReal  translationY,
VuoInteger  viewportWidth,
VuoInteger  viewportHeight,
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.

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.

static bool VuoTransform_isIdentity ( const VuoTransform  transform)
inlinestatic

Returns true if the transform is an identity (i.e., causes no change).

struct json_object * VuoTransform_jsonFromValue ( const VuoTransform  value)
read

Encodes value as a JSON object.

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_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.

static void VuoTransform_multiplyMatrices4x4 ( const float *  a,
const float *  b,
float *  outputMatrix 
)
inlinestatic

Multiplies the specified matrices.

static void VuoTransform_printMatrix4x4 ( const float *  matrix)
inlinestatic

Prints the specified column-major matrix.

static VuoPoint4d VuoTransform_quaternionComposite ( VuoPoint4d  a,
VuoPoint4d  b 
) const
inlinestatic

Returns the composite of quaternion a with quaternion b (i.e., the rotation described by a followed by the rotation described by b).

static VuoPoint4d VuoTransform_quaternionFromAxisAngle ( VuoPoint3d  axis,
float  angle 
) const
inlinestatic

Returns the quaternion describing the rotation of angle radians about axis.

static VuoPoint4d VuoTransform_quaternionFromVectors ( VuoPoint3d  from,
VuoPoint3d  to 
) const
inlinestatic

Returns the quaternion describing the rotation from direction a to b.

char* VuoTransform_stringFromValue ( const VuoTransform  value)

Automatically generated function.

char * VuoTransform_summaryFromValue ( const VuoTransform  value)

Produces a brief human-readable summary of value.

VuoPoint3d VuoTransform_transformPoint ( const float *  matrix,
VuoPoint3d  point 
)

Transforms point using matrix (a column-major matrix of 16 values), and returns the new point.

See Also
VuoTransform_getMatrix
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.

See Also
VuoTransform_getMatrix
VuoTransform VuoTransform_valueFromJson ( json_object *  js)

Decodes the JSON object js to create a new value.

Example:
"identity"
Example:
{
"quaternionRotation" = [0,0,0,1],
"translation" = [0,0,0],
"scale" = [1,1,1]
}
Example:
{
"eulerRotation" = [0,0,0],
"translation" = [0,0,0],
"scale" = [1,1,1]
}
VuoTransform VuoTransform_valueFromString ( const char *  str)

Automatically generated function.