Rotation transform matrix
Author: C | 2025-04-24
Transformation matrix, subscripts indicate rotation angles and order of rotation Inverse of transformation matrix Transpose of transformation matrix Determinant of transformation matrix
Matrix Rotations and Transformations - MathWorks
Struct in UnityEngine/Implemented in:UnityEngine.CoreModuleSuggest a changeSuccess!Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.CloseSubmission failedFor some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.CloseYour nameYour emailSuggestion*CancelDescriptionA standard 4x4 transformation matrix.A transformation matrix can perform arbitrary linear 3D transformations (i.e. translation, rotation, scale, shear etc.)and perspective transformations using homogenous coordinates. You rarely use matrices in scripts; mostoften using Vector3s, Quaternions and functionality of Transform class is more straightforward. Plain matrices are used in special caseslike setting up nonstandard camera projection.In Unity, several Transform, Camera, Material, Graphics and GL functions use Matrix4x4.Matrices in Unity are column major; i.e. the position of a transformation matrix is in the last column,and the first three columns contain x, y, and z-axes. Data is accessed as:row + (column*4). Matrices can beindexed like 2D arrays but note that in an expression like mat[a, b], a refers to the row index, while b refersto the column index.using UnityEngine;public class ExampleScript : MonoBehaviour{ void Start() { // get matrix from the Transform var matrix = transform.localToWorldMatrix; // get position from the last column var position = new Vector3(matrix[0,3], matrix[1,3], matrix[2,3]); Debug.Log("Transform position from matrix is: " + position); }}Static PropertiesidentityReturns the identity matrix (Read Only).zeroReturns a matrix with all elements set to zero (Read Only).PropertiesdecomposeProjectionThis property takes a projection matrix and returns the six plane coordinates that define a projection frustum.determinantThe determinant of the matrix. (Read Only)inverseThe inverse of this matrix. (Read Only)isIdentityChecks whether this is an identity matrix. (Read Only)lossyScaleAttempts to get a scale value from the matrix. (Read Only)rotationAttempts to get a rotation quaternion from this matrix.this[int,int]Access element at [row, column].transposeReturns the transpose of this matrix (Read Only).Public MethodsGetColumnGet a column of the matrix.GetRowReturns a row of the matrix.MultiplyPointTransforms a position by this matrix (generic).MultiplyPoint3x4Transforms a position by this matrix (fast).MultiplyVectorTransforms a direction by this matrix.SetColumnSets a column of the matrix.SetRowSets a row of the matrix.SetTRSSets this matrix to a translation, rotation and scaling matrix.ToStringReturns a formatted string for this matrix.TransformPlaneReturns a plane that is transformed in space.ValidTRSChecks if this matrix is a valid transform matrix.Static MethodsFrustumThis function returns a projection matrix with viewing frustum that has a near plane defined by the coordinates that were passed in.Inverse3DAffineComputes the inverse of a 3D affine matrix.LookAtCreate a "look at" matrix.OrthoCreate an orthogonal projection matrix.PerspectiveCreate a perspective projection matrix.RotateCreates a rotation matrix.ScaleCreates a scaling matrix.TranslateCreates a translation matrix.TRSCreates a translation, rotation and scaling matrix.OperatorsDid you find this page useful? Please give it a rating:
Matrix Transformations : reflections and rotations - YouTube
I posted this question and found some theory on matrix calculations, but this is way over my head in the math and excel department. Your spreadsheet works perfectly for my intended purpose. I have checked it a few times utilizing CAD. I see your 2nd post indicating "the last column of the transform matrix should be zero but for the last". It seems the spreadsheet works with that column with all 1's or 3 0's and a 1. Thank you again so much for freely sharing your brilliance. I'd hope somehow that I could return the favor, it not to you, then to someone else. 06-03-2013, 08:42 PM #5 Re: 3D Coordinate Translation and Rotation Formulas for Excel. You're welcome. It seems the spreadsheet works with that column with all 1's or 3 0's and a 1. It's doesn't matter for this case, but it makes the homogeneous coordinate W=1, which is essential if additional transformations are to be applied to the result. 09-30-2014, 03:40 PM #6 Registered User Re: 3D Coordinate Translation and Rotation Formulas for Excel. I am trying to get Excel to do something very similar to the OP - so I believe this posted solution may work for me. When I look at the file, however, it appears that the inputs to the transformation are the trans x,y,z and the roll,pitch,yaw angles. What I am looking for is to have Excel calculate the 4x4 matrix (rotation with translation), derived from the A,B,C and A',B',C' points. I don't know my translation and roll,pitch,yaw (and don't really care) - I just want to be able to pass additional points (D,E, etc) through the same transform to get D',E', etc.Can this file be modified to suit my needs, or does somebody have a better solution? Thanks! 10-01-2014, 10:37 AM #7 Re: 3D Coordinate Translation and Rotation Formulas for Excel. The posted solution turned out to be insufficient. Here was the problem.Given two congruent triangles in space ({A1,B1,C1} and {A2,B2,C2}), find the homogeneous transform matrix that maps one to the other.The solution was to 1) Form a homogeneous translation matrix that puts A1 at the origin,2) Form a quaternion rotation that puts B1 along +z (it can't be a Euler angle rotation, because that could gimbal lock). Convert the quaternion to a homogeneous rotation matrix. 3) Form a rotation about +z to put C1 in the x-y plane4, 5, 6) Repeat steps 1 to 3 for the second triangleThe matrix derived in steps 1 to 3, times the inverse of the matrix in steps 4 to 6, maps triangle 1 to triangle 2.Easy for a mathematician, but a struggle for this engineer. Last edited by shg; 10-01-2014 at 11:10 AM.Rotation and transformation of coordinates of stiffness matrix
2D transformstranslate()rotate()scale()skewX()skewY()skew()matrix()3D transformsThe rotate functionTransform PropertiesFAQsWhat are 2D and 3D transforms? What types of transformations can be applied in 2D space?What types of transformations can be applied in 3D space? How are 2D and 3D transforms implemented in computer graphics? What are some practical applications of 2D and 3D transforms?As we know, in CSS, we can do every type of decoration or design to an element. Sometimes we have to decorate an element by its shape, size, and position. There we can use the transformation property. In 2D transformation, an element can be arranged along with its X-axis and Y-axis. There are six main types of transformation.translate()rotate()scale()skewX()skew()matrix()translate()When we need to move an element along with its X-axis and Y-axis from its actual position then we use translate().Ex-2D Transform.trans {font-size: 35px;margin: 10px 0;margin-left: 80px;}img {border: 1px solid black;transition-duration: 2s;-webkit-transition-duration: 2s;}img:hover {transform: translate(100px, 100px);/* prefix for IE 9 */-ms-transform: translate(100px, 100px);/* prefix for Safari and Chrome */-webkit-transform: translate(100px, 100px);}Translate() Method“ />rotate()This is used to rotate an element clockwise or anti-clockwise along with the degree value as per our requirements.Ex-2D Transformimg {border: 1px solid black;}img:hover {/* IE 9 */-ms-transform: rotate(20deg);/* Safari */-webkit-transform: rotate(20deg);/* Standard syntax */transform: rotate(20deg);}.transs {font-size: 25px;text-align: center;margin-top: 100px;}Rotation() Method“ />scale()When we need to increase or decrease the size of an element, then we use this property. Because sometimes, the real image size can’t fit as per the height and width. So we have to change the size as per height and width.Ex-2D Transformimg {border: 1px solid black;}img:hover {/* IE 9 */-ms-transform: scale(1, 2);/* Safari */-webkit-transform: scale(1, 1);/* Standard syntax */transform: scale(1, 2);}.transss {font-size: 25px;text-align: center;margin-top: 100px;}Scale() Method“ />skewX()This method is used to skew an element. It happens on X-axis.Ex-2D Transformimg {border: 1px solid black;}img:hover {/* IE 9 */-ms-transform: skewX(20deg);/* Safari */-webkit-transform: skewX(20deg);/* Standard syntax */transform: skewX(20deg);}.tranns {font-size: 25px;text-align: center;margin-top: 100px;}skewX() Method“ />skewY()This method is used to skew an element. It happens on Y-axis.Ex-2D Transformimg {border: 1px solid black;}img:hover {/* IE 9 */-ms-transform: skewY(20deg);/* Safari */-webkit-transform: skewY(20deg);/* Standard syntax */transform: skewY(20deg);}.ttrans {font-size: 25px;text-align: center;margin-top: 100px;}skewY() Methodskew()This method skews an element in both X-axis and the Y-axis. The degree value can be the same or different as per our requirements.Ex-2D Transformimg {border: 1px solid black;}img:hover {/* IE 9 */-ms-transform: skew(20deg, 10deg);/* Safari */-webkit-transform: skew(20deg, 10deg);/* Standard syntax */transform: skew(20deg, 10deg);}.transform {font-size: 25px;text-align: center;margin-top: 100px;}skew() Method“ />matrix()It is used when we need to use all the methods of 2D transformation properties in a single page. We can take all six properties here like matrix(scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY() ).Let’s take en example –Ex-2D Transformimg {border: 1px solid black;}img:hover {/* IE 9 */-ms-transform: matrix(1, -0.3, 0, 1, 0, 0);/* Safari */-webkit-transform: matrix(1, -0.3, 0, 1, 0, 0);/* Standard syntax */transform: matrix(1, -0.3, 0,. Transformation matrix, subscripts indicate rotation angles and order of rotation Inverse of transformation matrix Transpose of transformation matrix Determinant of transformation matrixFind the Rotation and Skew of a Matrix transformation
Options Subscribe to RSS Feed Mark Topic as New Mark Topic as Read Float this Topic for Current User Bookmark Subscribe Mute Printer Friendly Page Matrix Transform nodes & Pivot Point adjustment Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report Is it be possible to adjust the pivot point location of a Matrix Transform node?When I try to adjust it with the Transform manipulator I get this error: vrNodeUtils::setTransformNodeRotatePivot: Transform3D needed!Normally, using a Group node instead would work.However these nodes are tracked objects and when we enable VRPN Tracking and a Raytracing Clusterthey become "stuck" at 0,0,0 (they rotate but do not translate)They have to be converted to Matrix Transform nodes to get them to translate.After converting, the pivot point jumps to a new location which is not where I want it to be. Regards,Dan Back to Topic Listing Previous Next Replies (5) Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report Hi Andrew,I have used this method for adjusting pivots of non Matrix Transform nodes...# Create a sphere at the desired pivot point location & name it PivotPoint# Select the node to be adjusted, then run this bit of codepivotNode = findNode('PivotPoint')pivotPos = getTransformNodeRotatePivot(pivotNode, 1)nodeToAdjust = getSelectedNode()setTransformNodeRotatePivot(nodeToAdjust, pivotPos.x(), pivotPos.y(), pivotPos.z(), 1) Regards,Dan Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report Hi,this is not possible. A matrix transform has by definition only a matrix and therefore does not know anything about pivots.To clarify this a bit: A pivot is basically just a part of a sequence of matrix multiplications used to create the final transform-matrix. If you take a look at the maya documentation there is a good describtion of how a transformmatrix is constructed: version is very similar except for a difference in handling the rotation orientation. Once you have the final matrix there is no way to reconstruct the individual parts. It is like having a 4 and wanting to know if it was calculated by 1+3, 2+2 or 3+1. You will have to use a transform3d so you can access the individual components.Kind regardsMichael Michael NikelskySr. Principal Engineer Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report Hi Michael,Thanks for the info.I would prefer to just use a Group node so I can adjust it's rotation point.Is there some other method to allow a Group node to track while Raytracing (w/cluster) is active? Regards,Dan Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report I don´t think so. It also does not make much sense, the tracking system only delivers a matrix since a pivot simply does not matter at all for tracked data.In case you would want to set that matrix to a transform node with a different pivot you would have to decompose the matrix to individual translate, rotate, scale values, recalculate them for a different rotation pivot and then reapply it. You can try to do this in python by calling getTransformNodeRotation/Translation/... onRotation Matrix for Coordinate Transformation - YouTube
Need to create lets you define the position of a node when its transform attributes are zeroed out reduces computational overhead and simplifies editing in the node editor Currently in Maya, most constraint computation is matrix math, the result of which is decomposed to scale, rotation, and translation values that are then used to drive other transforms. This leads to extra complexity in the graph and excessive computation. The offsetParentMatrix is inserted in the transform model after the parent matrix and acts as an offset to its own parent matrix. This new attribute lets you skip the expensive decomposition/composition step. It has the added benefit of leaving the driven transform’s scale, rotation, and translation channels available for animation. This process reduces the number of DAG and DG nodes riggers need to create in rigs. Transform Offset Parent Matrix Matrix operators New Utility nodes Two new utility nodes, uvPin and proximityPin, have been created to allow transforms to follow geometry. These nodes offer better performance than the follicle or pointOnPoly constraints they replace and give you more control over how a transform can follow a surface. Rivet command A new Rivet command offers a one-step way to leverage the power of the new matrix-driven transforms together with the uvPin node. Use Rivet to create locators that attach directly to a deforming mesh. Rivet uses pinUV, with predefined settings to give you a simple way to attach things like a prop to a character, such as sticking a button on a shirt,Creating a transformation matrix for OpenGL with GLM (Rotations)
Deprecated in Current ReleaseRequirementsSoftware operationDefining Calibration TasksDefinitions and TheorySupported SystemsSupported TargetsRequired EvidenceTest SetupCalibration ProcedureUser InterfaceUse in Imatest ITModule settingsModule outputsDefining a DeviceDefining DistortionDefining the System of DevicesDefining the TargetDefining a Test CaptureDefining a Test ImageHomogenous CoordinatesProjective Camera ModelMulti-Camera SystemsDistortion ModelsCoordinate SystemsRotations and TranslationsTranslationsLet \(\mathbf{X}=\left[\begin{array}{ccc}X&Y&Z\end{array}\right]^{\top}\) be a point in \(\mathbb{R}^3\) and let \(\mathbf{X}’=\left[\begin{array}{ccc}X’&Y’&Z’\end{array}\right]^{\top}\) be \(\mathbf{X}\) after a translation by \(\left[\begin{array}{ccc}\Delta X&\Delta Y&\Delta Z\end{array}\right]^{\top}\). Translations may be represented by a single \(4\times4\) matrix acting on a \(4\times1\) homogeneous coordinate. \(\begin{bmatrix}X’\\Y’\\Z’\\1\end{bmatrix}=\begin{bmatrix}1&0&0&\Delta X\\0&1&0&\Delta Y\\0&0&1&\Delta Z\\0&0&0&1\end{bmatrix}\begin{bmatrix}X\\Y\\Z\\1\end{bmatrix}=\begin{bmatrix}X+\Delta X\\Y+\Delta Y\\Z+\Delta Z\\1\end{bmatrix}\)A translation can be inverted by applying the negative of the translation terms\(\begin{bmatrix}X\\Y\\Z\\1\end{bmatrix}=\begin{bmatrix}1&0&0&\Delta X\\0&1&0&\Delta Y\\0&0&1&\Delta Z\\0&0&0&1\end{bmatrix}^{-1}\begin{bmatrix}X’\\Y’\\Z’\\1\end{bmatrix}=\begin{bmatrix}1&0&0&-\Delta X\\0&1&0&-\Delta Y\\0&0&1&-\Delta Z\\0&0&0&1\end{bmatrix}\begin{bmatrix}X’\\Y’\\Z’\\1\end{bmatrix}\)RotationsIn \(\mathbb{R}^3\), the rotation of points about the origin are described by a \(3\times3\) matrix \(\mathbf{R}\). Valid rotation matrices obey the following properties:\(\mathrm{det}\left(\mathbf{R}\right) = +1\)\(\mathbf{R}^{-1}=\mathbf{R}^{\top}\)From these properties, both the columns and rows of \(\mathbf{R}\) are orthonormal.The rotation is applied by left-multipling the points by the rotation matrix.\(\begin{bmatrix}X’\\Y’\\Z’\end{bmatrix}=\begin{bmatrix}R_{11}&R_{12}&R_{13}\\R_{21}&R_{22}&R_{23}\\R_{31}&R_{32}&R_{33}\end{bmatrix}\begin{bmatrix}X\\Y\\Z\end{bmatrix}=\begin{bmatrix}R_{11}X+R_{12}Y+R_{13}Z\\R_{21}X+R_{22}Y+R_{23}Z\\R_{31}X+R_{32}Y+R_{33}Z\end{bmatrix}\)Rotations of 3D homogeneous may be defined by a \(4\times4\) matrix\(\begin{bmatrix}X’\\Y’\\Z’\\1\end{bmatrix}=\begin{bmatrix}R_{11}&R_{12}&R_{13}&0\\R_{21}&R_{22}&R_{23}&0\\R_{31}&R_{32}&R_{33}&0\\0&0&0&1\end{bmatrix}\begin{bmatrix}X\\Y\\Z\\1\end{bmatrix}\)Rotation of axes are defined by the inverse (transpose) of the rotation matrix transforming points by the same amount. A rotation of axes is also referred to as a pose. Unless specified, the rest of this page uses implies rotation to be a rotation of points about the origin.Basic RotationsA non-rotation is described by an identity matrix\(\mathbf{R}_{0}(\theta)=\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}\)The right-handed rotation of points about the the \(X\), \(Y\), and \(Z\) axes are given by:\(\mathbf{R}_{X}(\theta)=\begin{bmatrix}1&0&0\\0&\cos\theta&-\sin\theta\\0&\sin\theta&\cos\theta\end{bmatrix}\)\(\mathbf{R}_{Y}(\theta)=\begin{bmatrix}\cos\theta&0&\sin\theta\\0&1&0\\-\sin\theta&0&\cos\theta\end{bmatrix}\)\(\mathbf{R}_{Z}(\theta)=\begin{bmatrix}\cos\theta&-\sin\theta&0\\\sin\theta&\cos\theta&0\\0&0&1\end{bmatrix}\)The inverse of these rotations are given by:\(\mathbf{R}^{-1}_{X}(\theta)=\mathbf{R}_{X}(-\theta)=\begin{bmatrix}1&0&0\\0&\cos\theta&\sin\theta\\0&-\sin\theta&\cos\theta\end{bmatrix}\)\(\mathbf{R}^{-1}_{Y}(\theta)=\mathbf{R}_{Y}(-\theta)=\begin{bmatrix}\cos\theta&0&-\sin\theta\\0&1&0\\\sin\theta&0&\cos\theta\end{bmatrix}\)\(\mathbf{R}^{-1}_{Z}(\theta)=\mathbf{R}_{Z}(-\theta)=\begin{bmatrix}\cos\theta&\sin\theta&0\\-\sin\theta&\cos\theta&0\\0&0&1\end{bmatrix}\)The rotation of axes by \(\theta\) radians is equivalent to a rotation of points by \(-\theta\) radians. The choices of rotation of bases or rotation of points and handedness of the rotation(s) should be specified to all relevant parties to avoid ambiguities in meaning. Chaining RotationsRotations may be combined in sequence by matrix-multiplying their rotation matrices. When performing sequences of rotations, later rotations are left-multiplied. For example a transform is defined by first rotating by \(\mathbf{R}_1\), then by \(\mathbf{R}_2\), and finally by \(\mathbf{R}_3\), the single rotation \(\mathbf{R}\) that describes the sequence of rotations is\(\mathbf{R}=\mathbf{R}_3\mathbf{R}_2\mathbf{R}_1\)Rotation-Translation CombinationsRotation-Translation MatricesA rotation about the origin followed by a translation may be described by a single \(4\times4\) matrix\(\begin{bmatrix}\mathbf{R}&\mathbf{t}\\\mathbf{0}^{\top}&1\end{bmatrix}\)where \(\mathbf{R}\) is the \(3\times3\) rotation matrix, \(\mathbf{t}\) is the \(3\times1\) translation, and \(\mathbf{0}\) is the \(3\times1\) vector of zeros.Since the last row of the \(4\times4\) rotation-translation matrix is always \(\begin{bmatrix}0&0&0&1\end{bmatrix}\), they are sometimes shorthanded to a \(3\times4\) augmented matrix\(\left[\begin{array}{c|c}\mathbf{R}&\mathbf{t}\end{array}\right]=\left[\begin{array}{ccc|c}R_{11}&R_{12}&R_{13}&t_{1}\\R_{21}&R_{22}&R_{23}&t_{2}\\R_{31}&R_{32}&R_{33}&t_{3}\end{array}\right]\)Note that when using this shorthand, matrix math is technically being broken as you cannot matrix multiply a \(3\times4\) matrix with a \(3\times4\) matrix. It is the implicit last row that is always the same that allows us to get away with this shorthand.Rotation-Translation InverseThe inverse of a rotation-translation matrix is given by\(\left[\begin{array}{c|c}\mathbf{R}&\mathbf{t}\end{array}\right]^{-1}=\left[\begin{array}{c|c}\mathbf{R}^{-1}&-\mathbf{R}^{-1}\mathbf{t}\end{array}\right]=\left[\begin{array}{c|c}\mathbf{R}^{\top}&-\mathbf{R}^{\top}\mathbf{t}\end{array}\right]\)Chaining Rotation-TranslationsJust like pure rotation matrices, later rotation-translation transforms are left multiplied. Given. Transformation matrix, subscripts indicate rotation angles and order of rotation Inverse of transformation matrix Transpose of transformation matrix Determinant of transformation matrix What is the difference between a rotation matrix and a transformation matrix? A rotation matrix is a specific type of transformation matrix that represents a rotation in Euclidean space. Transformation matrices can include other types of transformations, such as scaling, shearing, and translation.Comments
Struct in UnityEngine/Implemented in:UnityEngine.CoreModuleSuggest a changeSuccess!Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.CloseSubmission failedFor some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.CloseYour nameYour emailSuggestion*CancelDescriptionA standard 4x4 transformation matrix.A transformation matrix can perform arbitrary linear 3D transformations (i.e. translation, rotation, scale, shear etc.)and perspective transformations using homogenous coordinates. You rarely use matrices in scripts; mostoften using Vector3s, Quaternions and functionality of Transform class is more straightforward. Plain matrices are used in special caseslike setting up nonstandard camera projection.In Unity, several Transform, Camera, Material, Graphics and GL functions use Matrix4x4.Matrices in Unity are column major; i.e. the position of a transformation matrix is in the last column,and the first three columns contain x, y, and z-axes. Data is accessed as:row + (column*4). Matrices can beindexed like 2D arrays but note that in an expression like mat[a, b], a refers to the row index, while b refersto the column index.using UnityEngine;public class ExampleScript : MonoBehaviour{ void Start() { // get matrix from the Transform var matrix = transform.localToWorldMatrix; // get position from the last column var position = new Vector3(matrix[0,3], matrix[1,3], matrix[2,3]); Debug.Log("Transform position from matrix is: " + position); }}Static PropertiesidentityReturns the identity matrix (Read Only).zeroReturns a matrix with all elements set to zero (Read Only).PropertiesdecomposeProjectionThis property takes a projection matrix and returns the six plane coordinates that define a projection frustum.determinantThe determinant of the matrix. (Read Only)inverseThe inverse of this matrix. (Read Only)isIdentityChecks whether this is an identity matrix. (Read Only)lossyScaleAttempts to get a scale value from the matrix. (Read Only)rotationAttempts to get a rotation quaternion from this matrix.this[int,int]Access element at [row, column].transposeReturns the transpose of this matrix (Read Only).Public MethodsGetColumnGet a column of the matrix.GetRowReturns a row of the matrix.MultiplyPointTransforms a position by this matrix (generic).MultiplyPoint3x4Transforms a position by this matrix (fast).MultiplyVectorTransforms a direction by this matrix.SetColumnSets a column of the matrix.SetRowSets a row of the matrix.SetTRSSets this matrix to a translation, rotation and scaling matrix.ToStringReturns a formatted string for this matrix.TransformPlaneReturns a plane that is transformed in space.ValidTRSChecks if this matrix is a valid transform matrix.Static MethodsFrustumThis function returns a projection matrix with viewing frustum that has a near plane defined by the coordinates that were passed in.Inverse3DAffineComputes the inverse of a 3D affine matrix.LookAtCreate a "look at" matrix.OrthoCreate an orthogonal projection matrix.PerspectiveCreate a perspective projection matrix.RotateCreates a rotation matrix.ScaleCreates a scaling matrix.TranslateCreates a translation matrix.TRSCreates a translation, rotation and scaling matrix.OperatorsDid you find this page useful? Please give it a rating:
2025-04-17I posted this question and found some theory on matrix calculations, but this is way over my head in the math and excel department. Your spreadsheet works perfectly for my intended purpose. I have checked it a few times utilizing CAD. I see your 2nd post indicating "the last column of the transform matrix should be zero but for the last". It seems the spreadsheet works with that column with all 1's or 3 0's and a 1. Thank you again so much for freely sharing your brilliance. I'd hope somehow that I could return the favor, it not to you, then to someone else. 06-03-2013, 08:42 PM #5 Re: 3D Coordinate Translation and Rotation Formulas for Excel. You're welcome. It seems the spreadsheet works with that column with all 1's or 3 0's and a 1. It's doesn't matter for this case, but it makes the homogeneous coordinate W=1, which is essential if additional transformations are to be applied to the result. 09-30-2014, 03:40 PM #6 Registered User Re: 3D Coordinate Translation and Rotation Formulas for Excel. I am trying to get Excel to do something very similar to the OP - so I believe this posted solution may work for me. When I look at the file, however, it appears that the inputs to the transformation are the trans x,y,z and the roll,pitch,yaw angles. What I am looking for is to have Excel calculate the 4x4 matrix (rotation with translation), derived from the A,B,C and A',B',C' points. I don't know my translation and roll,pitch,yaw (and don't really care) - I just want to be able to pass additional points (D,E, etc) through the same transform to get D',E', etc.Can this file be modified to suit my needs, or does somebody have a better solution? Thanks! 10-01-2014, 10:37 AM #7 Re: 3D Coordinate Translation and Rotation Formulas for Excel. The posted solution turned out to be insufficient. Here was the problem.Given two congruent triangles in space ({A1,B1,C1} and {A2,B2,C2}), find the homogeneous transform matrix that maps one to the other.The solution was to 1) Form a homogeneous translation matrix that puts A1 at the origin,2) Form a quaternion rotation that puts B1 along +z (it can't be a Euler angle rotation, because that could gimbal lock). Convert the quaternion to a homogeneous rotation matrix. 3) Form a rotation about +z to put C1 in the x-y plane4, 5, 6) Repeat steps 1 to 3 for the second triangleThe matrix derived in steps 1 to 3, times the inverse of the matrix in steps 4 to 6, maps triangle 1 to triangle 2.Easy for a mathematician, but a struggle for this engineer. Last edited by shg; 10-01-2014 at 11:10 AM.
2025-04-22Options Subscribe to RSS Feed Mark Topic as New Mark Topic as Read Float this Topic for Current User Bookmark Subscribe Mute Printer Friendly Page Matrix Transform nodes & Pivot Point adjustment Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report Is it be possible to adjust the pivot point location of a Matrix Transform node?When I try to adjust it with the Transform manipulator I get this error: vrNodeUtils::setTransformNodeRotatePivot: Transform3D needed!Normally, using a Group node instead would work.However these nodes are tracked objects and when we enable VRPN Tracking and a Raytracing Clusterthey become "stuck" at 0,0,0 (they rotate but do not translate)They have to be converted to Matrix Transform nodes to get them to translate.After converting, the pivot point jumps to a new location which is not where I want it to be. Regards,Dan Back to Topic Listing Previous Next Replies (5) Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report Hi Andrew,I have used this method for adjusting pivots of non Matrix Transform nodes...# Create a sphere at the desired pivot point location & name it PivotPoint# Select the node to be adjusted, then run this bit of codepivotNode = findNode('PivotPoint')pivotPos = getTransformNodeRotatePivot(pivotNode, 1)nodeToAdjust = getSelectedNode()setTransformNodeRotatePivot(nodeToAdjust, pivotPos.x(), pivotPos.y(), pivotPos.z(), 1) Regards,Dan Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report Hi,this is not possible. A matrix transform has by definition only a matrix and therefore does not know anything about pivots.To clarify this a bit: A pivot is basically just a part of a sequence of matrix multiplications used to create the final transform-matrix. If you take a look at the maya documentation there is a good describtion of how a transformmatrix is constructed: version is very similar except for a difference in handling the rotation orientation. Once you have the final matrix there is no way to reconstruct the individual parts. It is like having a 4 and wanting to know if it was calculated by 1+3, 2+2 or 3+1. You will have to use a transform3d so you can access the individual components.Kind regardsMichael Michael NikelskySr. Principal Engineer Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report Hi Michael,Thanks for the info.I would prefer to just use a Group node so I can adjust it's rotation point.Is there some other method to allow a Group node to track while Raytracing (w/cluster) is active? Regards,Dan Mark as New Bookmark Subscribe Mute Subscribe to RSS Feed Permalink Print Report I don´t think so. It also does not make much sense, the tracking system only delivers a matrix since a pivot simply does not matter at all for tracked data.In case you would want to set that matrix to a transform node with a different pivot you would have to decompose the matrix to individual translate, rotate, scale values, recalculate them for a different rotation pivot and then reapply it. You can try to do this in python by calling getTransformNodeRotation/Translation/... on
2025-04-07Need to create lets you define the position of a node when its transform attributes are zeroed out reduces computational overhead and simplifies editing in the node editor Currently in Maya, most constraint computation is matrix math, the result of which is decomposed to scale, rotation, and translation values that are then used to drive other transforms. This leads to extra complexity in the graph and excessive computation. The offsetParentMatrix is inserted in the transform model after the parent matrix and acts as an offset to its own parent matrix. This new attribute lets you skip the expensive decomposition/composition step. It has the added benefit of leaving the driven transform’s scale, rotation, and translation channels available for animation. This process reduces the number of DAG and DG nodes riggers need to create in rigs. Transform Offset Parent Matrix Matrix operators New Utility nodes Two new utility nodes, uvPin and proximityPin, have been created to allow transforms to follow geometry. These nodes offer better performance than the follicle or pointOnPoly constraints they replace and give you more control over how a transform can follow a surface. Rivet command A new Rivet command offers a one-step way to leverage the power of the new matrix-driven transforms together with the uvPin node. Use Rivet to create locators that attach directly to a deforming mesh. Rivet uses pinUV, with predefined settings to give you a simple way to attach things like a prop to a character, such as sticking a button on a shirt,
2025-04-14