SketchUp C API
|
Represents a 3D (4x4) geometric transformation matrix. More...
#include <SketchUpAPI/geometry.h>
Data Fields | |
double | values [16] |
Matrix values in column-major order. | |
Related Functions | |
(Note that these are not member functions.) | |
enum SUResult | SUTransformationSetFromPointAndNormal (struct SUTransformation *transform, const struct SUPoint3D *point, const struct SUVector3D *normal) |
Sets the transformation based on the provided point and z-axis vector. The resulting transformation transforms points/vectors to a new coordinate system where the provided point is the new origin and the vector is the new z-axis. The other two axes in the transformed space are computed using the "Arbitrary axis algorithm". More... | |
enum SUResult | SUTransformationSetFromPointAndAxes (struct SUTransformation *transform, const struct SUPoint3D *point, const struct SUVector3D *x_axis, const struct SUVector3D *y_axis, const struct SUVector3D *z_axis) |
Sets the transformation based on the provided origin and axes. More... | |
enum SUResult | SUTransformationTranslation (struct SUTransformation *transform, const struct SUVector3D *vector) |
Creates a translation transformation using the given vector. More... | |
enum SUResult | SUTransformationScale (struct SUTransformation *transform, double scale) |
Creates a scale transformation using the given scale value. More... | |
enum SUResult | SUTransformationNonUniformScale (struct SUTransformation *transform, double x_scale, double y_scale, double z_scale) |
Creates a scale transformation using the given scale values. More... | |
enum SUResult | SUTransformationScaleAboutPoint (struct SUTransformation *transform, const struct SUPoint3D *point, double scale) |
Creates a scale transformation using the given scale value and origin. More... | |
enum SUResult | SUTransformationNonUniformScaleAboutPoint (struct SUTransformation *transform, const struct SUPoint3D *point, double x_scale, double y_scale, double z_scale) |
Creates a scale transformation using the given scale values and origin. More... | |
enum SUResult | SUTransformationRotation (struct SUTransformation *transform, const struct SUPoint3D *point, const struct SUVector3D *vector, double angle) |
Creates a transformation given an origin, vector of rotation, and angle. More... | |
enum SUResult | SUTransformationInterpolate (struct SUTransformation *transform, const struct SUTransformation *t1, const struct SUTransformation *t2, double weight) |
Performs an interpolation between two transformations. The weight determines the amount of interpolation. A weight of 0.0 would return a transformation of t1, while a weight of 1.0 would return a transformation of t2. More... | |
enum SUResult | SUTransformationIsIdentity (const struct SUTransformation *transform, bool *is_identity) |
Gets whether the transformation is an identity transformation. More... | |
enum SUResult | SUTransformationGetInverse (const struct SUTransformation *transform, struct SUTransformation *inverse) |
Gets the inverse transformation of the given transformation object. More... | |
enum SUResult | SUTransformationGetOrigin (const struct SUTransformation *transform, struct SUPoint3D *origin) |
Gets the origin point of the given transformation object. More... | |
enum SUResult | SUTransformationGetXAxis (const struct SUTransformation *transform, struct SUVector3D *x_axis) |
Gets the x axis vector of the given transformation object. More... | |
enum SUResult | SUTransformationGetYAxis (const struct SUTransformation *transform, struct SUVector3D *y_axis) |
Gets the y axis vector of the given transformation object. More... | |
enum SUResult | SUTransformationGetZAxis (const struct SUTransformation *transform, struct SUVector3D *z_axis) |
Gets the z_axis vector of the given transformation object. More... | |
enum SUResult | SUTransformationGetZRotation (const struct SUTransformation *transform, double *z_rotation) |
Gets the rotation about the z axis from the given transformation object. More... | |
enum SUResult | SUTransformationMultiply (const struct SUTransformation *transform1, const struct SUTransformation *transform2, struct SUTransformation *out_transform) |
Multiplies a transformation by another transformation. More... | |
enum SUResult | SUTransformationIsMirrored (const struct SUTransformation *transform, bool *is_mirrored) |
Returns true if transformation has been mirrored. More... | |
Represents a 3D (4x4) geometric transformation matrix.
Matrix values are in column-major order. The transformation is stored as:
where:
|
related |
Gets the inverse transformation of the given transformation object.
[in] | transform | The transformation object. |
[out] | inverse | The inverse transformation object. |
|
related |
Gets the origin point of the given transformation object.
[in] | transform | The transformation object. |
[out] | origin | The origin point to be retrieved. |
|
related |
Gets the x axis vector of the given transformation object.
[in] | transform | The transformation object. |
[out] | x_axis | The x axis vector to be retrieved. |
|
related |
Gets the y axis vector of the given transformation object.
[in] | transform | The transformation object. |
[out] | y_axis | The y axis vector to be retrieved. |
|
related |
Gets the z_axis vector of the given transformation object.
[in] | transform | The transformation object. |
[out] | z_axis | The z_axis vector to be retrieved. |
|
related |
Gets the rotation about the z axis from the given transformation object.
[in] | transform | The transformation object. |
[out] | z_rotation | The rotation to be retrieved. |
|
related |
Performs an interpolation between two transformations. The weight determines the amount of interpolation. A weight of 0.0 would return a transformation of t1, while a weight of 1.0 would return a transformation of t2.
[out] | transform | The result of the interpolation. |
[in] | t1 | The first transformation object. |
[in] | t2 | The second transformation object. |
[in] | weight | The weight determines the amount of interpolation from t1 to t2. |
|
related |
Gets whether the transformation is an identity transformation.
[in] | transform | The transformation object. |
[out] | is_identity | Whether the transformation is identity. |
|
related |
Returns true if transformation has been mirrored.
[in] | transform | The transform object. |
[out] | is_mirrored | Indicates if mirrored. |
|
related |
Multiplies a transformation by another transformation.
[in] | transform1 | The transformation object to be multiplied. |
[in] | transform2 | The transformation object to multiply by. |
[out] | out_transform | The result of the matrix multiplication [transform1 * transform2]. |
|
related |
Creates a scale transformation using the given scale values.
[out] | transform | The transformation to be set. |
[in] | x_scale | The x-axis scale value for the transformation. |
[in] | y_scale | The y-axis scale value for the transformation. |
[in] | z_scale | The z-axis scale value for the transformation. |
|
related |
Creates a scale transformation using the given scale values and origin.
[out] | transform | The transformation to be set. |
[in] | point | The point specifying the translation component of the transformation. |
[in] | x_scale | The x-axis scale value for the transformation. |
[in] | y_scale | The y-axis scale value for the transformation. |
[in] | z_scale | The z-axis scale value for the transformation. |
|
related |
Creates a transformation given an origin, vector of rotation, and angle.
[out] | transform | The calculated transformation. |
[in] | point | The point specifying the translation component of the transformation. |
[in] | vector | The vector about which rotation will occur. |
[in] | angle | The rotation in radians for the transformation. |
|
related |
Creates a scale transformation using the given scale value.
[out] | transform | The transformation to be set. |
[in] | scale | The scale value for the transformation. |
|
related |
Creates a scale transformation using the given scale value and origin.
[out] | transform | The transformation to be set. |
[in] | point | The point specifying the translation component of the transformation. |
[in] | scale | The scale value for the transformation. |
|
related |
Sets the transformation based on the provided origin and axes.
[out] | transform | The transformation to be set. |
[in] | point | The point specifying the translation component of the transformation. |
[in] | x_axis | The 3D vector specifying the x-axis for the transformation. This is treated as a unit vector, so any scaling will be ignored. |
[in] | y_axis | The 3D vector specifying the y-axis for the transformation. This is treated as a unit vector, so any scaling will be ignored. |
[in] | z_axis | The 3D vector specifying the z-axis for the transformation. This is treated as a unit vector, so any scaling will be ignored. |
|
related |
Sets the transformation based on the provided point and z-axis vector. The resulting transformation transforms points/vectors to a new coordinate system where the provided point is the new origin and the vector is the new z-axis. The other two axes in the transformed space are computed using the "Arbitrary axis algorithm".
[out] | transform | The transformation to be set. |
[in] | point | The point specifying the translation component of the transformation. |
[in] | normal | The 3D vector specifying the rotation component of the transformation. This is treated as a unit vector, so any scaling will be ignored. |
|
related |
Creates a translation transformation using the given vector.
[out] | transform | The transformation to be set. |
[in] | vector | The 3D vector specifying the translation for the transformation. |