CGPdocs

affine_rts

Similarity transform: rotation + translation + uniform scaling.

module 09_geometric_transformationsource: affine_rts.hpp
T * p scales, rotates and then translates: affine_rt gives R p + t, affine_rts gives R s p + t, and affine gives R s S p + t, where S = diag(scaling_xyz) stretches the local axes of the shape before the rotation.
T * p scales, rotates and then translates: affine_rt gives R p + t, affine_rts gives R s p + t, and affine gives R s S p + t, where S = diag(scaling_xyz) stretches the local axes of the shape before the rotation. Tap to enlarge.

Fields and methods

Members of the struct affine_rts. Most of what you do with a CGP type goes through the free functions listed below.

Fields

rotation_transform rotationRotation part of the similarity transform.
vec3 translationTranslation part of the similarity transform, applied after the scaling and the rotation.
float scalingUniform scaling factor, applied before the rotation (default 1).

Methods

affine_rts()Builds the identity transform (identity rotation, zero translation, scaling 1).3 overloads src
affine_rts(affine_rt const& T)Builds the similarity with the rotation and translation of a rigid transform and scaling 1 (implicit conversion). src
affine_rts(rotation_transform const& rotation, vec3 const& translation, float scaling)Builds the similarity p -> scaling*(rotation*p) + translation (explicit). src
Sets the uniform scaling factor and returns a reference to the transform. src
Sets the translation and returns a reference to the transform. src
Sets the rotation and returns a reference to the transform. src
Returns the 4x4 matrix ((s R, t), (0, 1)) of the transform. src

Functions taking a affine_rts

Transform 1

affine_rts inverse(affine_rts const& T)

Inverse affine transform.

Convert 2

std::string str(affine_rts const& T)

String listing the rotation (quaternion), translation and scaling of the transform.

std::string type_str(affine_rts const&)

Type name "affine_rts".

Functions returning a affine_rts

None.

Operators

Show the 24 operators (+, -, *, ==, ...)

operator*

10 overloads
affine operator*(affine_rts const& T1, affine const& T2)
source

Composition T1 o T2 of a rotation-translation-scaling (parent) with an affine transform (child), exact for any scaling_xyz.

vec3 operator*(affine_rts const& T, vec3 const& p)
source

Apply the transform to a point: scaling * (rotation * p) + translation.

vec4 operator*(affine_rts const& T, vec4 const& p)
source

Apply the transform to a homogeneous vector, the translation being weighted by w.

affine_rts operator*(affine_rts const& T1, affine_rts const& T2)
source

Composition T1 o T2 of two rotation-translation-scaling transforms.

affine_rts operator*(affine_rts const& T, rotation_transform const& R)
source

Transform T o R: the rotation is applied before T.

affine_rts operator*(float s, affine_rts const& T)
source

Copy of the transform with its scaling multiplied by s, the translation being left unchanged.

affine_rts operator*(affine_rts const& T, float s)
source

Copy of the transform with its scaling multiplied by s, the translation being left unchanged.

affine_rts operator*(affine_rts const& T1, affine_rt const& T2)
source

Composition T1 o T2 of a rotation-translation-scaling with a rigid transform.

mat4 operator*(affine_rts const& T1, mat4 const& T2)
source

Product of the 4x4 matrix of the transform with a mat4.

mat4 operator*(affine_rts const& T1, mat3 const& T2)
source

Product of the 4x4 matrix of the transform with a mat3 extended to a mat4.

affine_rts operator+(affine_rts const& T, vec3 const& tr)

Copy of the transform with tr added to its translation.

affine_rts operator-(affine_rts const& T, vec3 const& tr)

Copy of the transform with tr subtracted from its translation.

affine_rts operator/(affine_rts const& T, float s)

Copy of the transform with its scaling divided by s, the translation being left unchanged.

std::ostream& operator<<(std::ostream& s, affine_rts const& T)

Write str(T) of the transform to the stream.

Documented on another page

  • operator*Composition T1 o T2 of an affine transform with a rotation-translation-scaling, returned as an affine; asserts that T1.scaling_xyz is uniform (use T1.matrix()*T2.matrix() otherwise).on affine
  • operator*x33 overloadson rotation_transform
  • operator*x33 overloadson affine_rt
  • operator*Product of a mat4 with the 4x4 matrix of the transform.on mat4
  • operator*Product of a mat3 extended to a mat4 with the 4x4 matrix of the transform.on mat3
  • operator+Copy of the transform with tr added to its translation.on vec3
CGP - Computer Graphics Programming.