Go to the documentation of this file.
10 #ifndef vtk_m_Transform3D_h
11 #define vtk_m_Transform3D_h
73 vtkm::Vec<T, 4> homogeneousVector(vector[0], vector[1], vector[2], T(0));
75 return vtkm::Vec<T, 3>(homogeneousVector[0], homogeneousVector[1], homogeneousVector[2]);
89 scaleMatrix(0, 0) = scaleX;
90 scaleMatrix(1, 1) = scaleY;
91 scaleMatrix(2, 2) = scaleZ;
92 scaleMatrix(3, 3) = T(1);
101 template <
typename T>
112 template <
typename T>
120 template <
typename T>
125 translateMatrix(0, 3) = x;
126 translateMatrix(1, 3) = y;
127 translateMatrix(2, 3) = z;
128 return translateMatrix;
130 template <
typename T>
143 template <
typename T>
147 T angleRadians = vtkm::Pi_180<T>() * angleDegrees;
154 matrix(0, 0) = normAxis[0] * normAxis[0] * (1 - cosAngle) + cosAngle;
155 matrix(0, 1) = normAxis[0] * normAxis[1] * (1 - cosAngle) - normAxis[2] * sinAngle;
156 matrix(0, 2) = normAxis[0] * normAxis[2] * (1 - cosAngle) + normAxis[1] * sinAngle;
159 matrix(1, 0) = normAxis[1] * normAxis[0] * (1 - cosAngle) + normAxis[2] * sinAngle;
160 matrix(1, 1) = normAxis[1] * normAxis[1] * (1 - cosAngle) + cosAngle;
161 matrix(1, 2) = normAxis[1] * normAxis[2] * (1 - cosAngle) - normAxis[0] * sinAngle;
164 matrix(2, 0) = normAxis[2] * normAxis[0] * (1 - cosAngle) - normAxis[1] * sinAngle;
165 matrix(2, 1) = normAxis[2] * normAxis[1] * (1 - cosAngle) + normAxis[0] * sinAngle;
166 matrix(2, 2) = normAxis[2] * normAxis[2] * (1 - cosAngle) + cosAngle;
176 template <
typename T>
186 template <
typename T>
196 template <
typename T>
206 template <
typename T>
214 #endif //vtk_m_Transform3D_h
VTKM_EXEC_CONT vtkm::Matrix< T, 4, 4 > Transform3DRotateY(T angleDegrees)
Returns a rotation matrix.
Definition: Transform3D.h:197
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC_CONT vtkm::Float32 Cos(vtkm::Float32 x)
Compute the cosine of x.
Definition: Math.h:269
VTKM_EXEC_CONT vtkm::Matrix< T, 4, 4 > Transform3DRotate(T angleDegrees, const vtkm::Vec< T, 3 > &axisOfRotation)
Returns a rotation matrix.
Definition: Transform3D.h:144
VTKM_EXEC_CONT vtkm::Vec< T, 3 > Transform3DPointPerspective(const vtkm::Matrix< T, 4, 4 > &matrix, const vtkm::Vec< T, 3 > &point)
Transform a 3D point by a transformation matrix with perspective.
Definition: Transform3D.h:53
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_EXEC_CONT vtkm::Vec< T, 3 > Transform3DPoint(const vtkm::Matrix< T, 4, 4 > &matrix, const vtkm::Vec< T, 3 > &point)
Transform a 3D point by a transformation matrix.
Definition: Transform3D.h:34
VTKM_EXEC_CONT vtkm::Vec< T, 3 > Transform3DVector(const vtkm::Matrix< T, 4, 4 > &matrix, const vtkm::Vec< T, 3 > &vector)
Transform a 3D vector by a transformation matrix.
Definition: Transform3D.h:70
VTKM_EXEC_CONT vtkm::Matrix< T, Size, Size > MatrixIdentity()
Returns the identity matrix.
Definition: Matrix.h:209
VTKM_EXEC_CONT vtkm::Float32 Sin(vtkm::Float32 x)
Compute the sine of x.
Definition: Math.h:210
VTKM_EXEC_CONT vtkm::Matrix< T, 4, 4 > Transform3DTranslate(const T &x, const T &y, const T &z)
Returns a translation matrix.
Definition: Transform3D.h:121
VTKM_EXEC_CONT T Normal(const T &x)
Returns a normalized version of the given vector.
Definition: VectorAnalysis.h:157
VTKM_EXEC_CONT vtkm::Matrix< T, NumRow, NumCol > MatrixMultiply(const vtkm::Matrix< T, NumRow, NumInternal > &leftFactor, const vtkm::Matrix< T, NumInternal, NumCol > &rightFactor)
Standard matrix multiplication.
Definition: Matrix.h:156
const VTKM_EXEC_CONT vtkm::Vec< T, NumCol > & MatrixGetRow(const vtkm::Matrix< T, NumRow, NumCol > &matrix, vtkm::IdComponent rowIndex)
Returns a tuple containing the given row (indexed from 0) of the given matrix.
Definition: Matrix.h:105
Basic Matrix type.
Definition: Matrix.h:33
VTKM_EXEC_CONT vtkm::Matrix< T, 4, 4 > Transform3DRotateZ(T angleDegrees)
Returns a rotation matrix.
Definition: Transform3D.h:207
VTKM_EXEC_CONT vtkm::Matrix< T, 4, 4 > Transform3DRotateX(T angleDegrees)
Returns a rotation matrix.
Definition: Transform3D.h:187
VTKM_EXEC_CONT vtkm::Matrix< T, 4, 4 > Transform3DScale(const T &scaleX, const T &scaleY, const T &scaleZ)
Returns a scale matrix.
Definition: Transform3D.h:84