Library of Assembled Shared Sources
|
a linear 3D transformation More...
#include <transformation_3d.h>
Public Member Functions | |
Transformation3D () | |
construct an identity transformation. | |
Transformation3D (const TPoint &origin, const TVector &baseX, const TVector &baseY, const TVector &baseZ) | |
construct an matrix from an origin and three base vectors | |
template<typename InputIterator> | |
Transformation3D (InputIterator first, InputIterator last) | |
construct a transformation from a 4x4 tranformation matrix. | |
const TSelf | inverse () const |
return the inverse transformation. | |
const TValue * | matrix () const |
Return pointer to row major matrix representation of transformation. | |
const TValue * | inverseMatrix () const |
Return pointer to row major matrix representation of inverse transformation. | |
Static Public Member Functions | |
static const TSelf | identity () |
make a 3D identity transformation | |
static const TSelf | translation (const TVector &offset) |
make a 3D transformation representing a translation | |
static const TSelf | scaler (TParam scale) |
make a 3D transformation representing a uniform scaling | |
static const TSelf | scaler (const TVector &scale) |
make a 3D transformation representing a scaling with different factors per axis | |
static const TSelf | rotation (XYZ axis, TParam radians) |
make a 3D transformation representing a rotation around a primary axis | |
static const TSelf | rotation (const TVector &axis, TParam radians) |
make a 3D transformation representing a rotation around an arbitrary axis | |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename T, class MMP> | |
Aabb2D< T, MMP > | transform (const Aabb2D< T, MMP > &subject, const Transformation2D< T > &transformation) |
apply transformation to axis aligned bounding box | |
template<typename T, class MMP> | |
Aabb3D< T, MMP > | transform (const Aabb3D< T, MMP > &subject, const Transformation3D< T > &transformation) |
apply transformation to axis aligned bounding box | |
template<typename T> | |
ColorRGBA | transform (const ColorRGBA &subject, const Transformation3D< T > &transformation) |
apply transformation to axis aligned bounding box | |
template<typename T, class NP> | |
Plane3D< T, Cartesian, NP > | transform (const Plane3D< T, Cartesian, NP > &plane, const Transformation3D< T > &transformation) |
apply transformation to cartesian plane | |
template<typename T, class NP> | |
Plane3D< T, Parametric, NP > | transform (const Plane3D< T, Parametric, NP > &plane, const Transformation3D< T > &transformation) |
apply transformation to parametric plane | |
template<typename T, class NP> | |
Plane3D< T, Combined, NP > | transform (const Plane3D< T, Combined, NP > &plane, const Transformation3D< T > &transformation) |
apply transformation to combined plane | |
template<typename T, class NP, class PP> | |
Ray3D< T, NP, PP > | transform (const Ray3D< T, NP, PP > &subject, const Transformation3D< T > &transformation) |
apply transformation to ray | |
template<typename T, class NP, class PP> | |
Ray3D< T, NP, PP > | transform (const Ray3D< T, NP, PP > &subject, const Transformation3D< T > &transformation, T &tRay) |
apply transformation to ray, and rescale a parameter to represent same point | |
template<typename T> | |
Transformation3D< T > | concatenate (const Transformation3D< T > &first, const Transformation3D< T > &second) |
concatenate two transformations first and second in one. | |
template<typename T> | |
Vector3D< T > | transform (const Vector3D< T > &subject, const Transformation3D< T > &transformation) |
apply transformation to a vector | |
template<typename T> | |
Point3D< T > | transform (const Point3D< T > &subject, const Transformation3D< T > &transformation) |
apply transformation to a point | |
template<typename T> | |
Vector3D< T > | normalTransform (const Vector3D< T > &subject, const Transformation3D< T > &transformation) |
apply transformation to a normal vector. | |
template<typename T> | |
std::pair< Vector3D< T >, T > | normalTransform (const std::pair< Vector3D< T >, T > &subject, const Transformation3D< T > &transformation) |
apply transformation to a 4D normal vector. | |
a linear 3D transformation
Definition at line 108 of file transformation_3d.h.
lass::prim::Transformation3D< T >::Transformation3D | ( | ) |
construct an identity transformation.
An identity transformation transforms every point to itself.
Definition at line 62 of file transformation_3d.inl.
Referenced by identity(), rotation(), rotation(), scaler(), scaler(), and translation().
lass::prim::Transformation3D< T >::Transformation3D | ( | const TPoint & | origin, |
const TVector & | baseX, | ||
const TVector & | baseY, | ||
const TVector & | baseZ ) |
construct an matrix from an origin and three base vectors
Definition at line 82 of file transformation_3d.inl.
lass::prim::Transformation3D< T >::Transformation3D | ( | InputIterator | first, |
InputIterator | last ) |
construct a transformation from a 4x4 tranformation matrix.
The elements of the 4x4 matrix will represented in a row major way by an iterator range [first, last) of 16 elements.
Definition at line 102 of file transformation_3d.inl.
const Transformation3D< T > lass::prim::Transformation3D< T >::inverse | ( | ) | const |
return the inverse transformation.
The inverse is calculated on the first call, and then cached for later use. For the transformation, we've use the C version of Cramer's rule as described in the Intel (R) article "Streaming SIMD Extensions -Inverse of 4x4 Matrix" which can be found here: http://www.intel.com/design/pentiumiii/sml/245043.htm
Definition at line 135 of file transformation_3d.inl.
Referenced by rotation(), scaler(), scaler(), and translation().
|
inline |
Return pointer to row major matrix representation of transformation.
This is for immediate use only, like std::basic_string::data()
.
Definition at line 149 of file transformation_3d.inl.
Referenced by lass::prim::Transformation3D< U >::concatenate(), lass::prim::Transformation3D< U >::transform(), lass::prim::Transformation3D< U >::transform(), and lass::prim::Transformation3D< U >::transform().
|
inline |
Return pointer to row major matrix representation of inverse transformation.
This is for immediate use only, like std::basic_string::data()
.
Definition at line 162 of file transformation_3d.inl.
Referenced by lass::prim::Transformation3D< U >::normalTransform(), and lass::prim::Transformation3D< U >::normalTransform().
|
apply transformation to ray, and rescale a parameter to represent same point
tRay |
|
Definition at line 111 of file ray_3d_transformation_3d.h.
|
concatenate two transformations first and second in one.
The result is one transformation that performs the same actions as first performing first and then second. Hence, the following lines of code are equivalent (ignoring numerical imprecions):
Definition at line 555 of file transformation_3d.inl.
|
apply transformation to a normal vector.
Vectors that represent a normal vector should transform differentely than ordinary vectors. Use this transformation function for normals.
Definition at line 615 of file transformation_3d.inl.
|
apply transformation to a 4D normal vector.
Vectors that represent a normal vector should transform differentely than ordinary vectors. Use this transformation function for normals.
Cartesian planes have a 4D normal vector that must be transformed in 3D. Use this function to do it:
Definition at line 640 of file transformation_3d.inl.