3D Matrix Transformation Simulator
Transform three-dimensional shapes using matrices. Experiment with rotation around the x, y, and z axes, scaling, reflection, shear, and translation. Enter your own 3 × 3 matrix and explore the transformed coordinates, determinant, volume scaling, and equivalent 4 × 4 homogeneous matrix.
Interactive 3D transformation
Edit the matrix or choose a predefined transformation.
Transformation matrix A
Enter the nine coefficients of the 3 × 3 matrix. Column vectors are used.
[ a₂₁ a₂₂ a₂₃ ]
[ a₃₁ a₃₂ a₃₃ ]
Translation vector
Translation is added after the linear transformation. It is represented in the 4 × 4 homogeneous matrix below.
3D visualization
Transformation results
Analyze the determinant, volume scaling, orientation, and transformed points.
3 × 3 linear matrix
4 × 4 homogeneous transformation matrix
This matrix combines the linear transformation and translation: p′ = H p, where p = [x, y, z, 1]ᵀ.
Transformed 3D coordinates
Each vertex is transformed using x′ = a₁₁x + a₁₂y + a₁₃z + tₓ, with equivalent equations for y′ and z′.
| Point | Original X | Original Y | Original Z | New X | New Y | New Z |
|---|---|---|---|---|---|---|
| P1 | -1 | -1 | -1 | -1 | -1 | -1 |
Step-by-step calculations
Apply a transformation to display the calculation details.
What are 3D matrix transformations?
A 3D matrix transformation is a mathematical operation that changes the coordinates of points in three-dimensional space. These transformations are fundamental in linear algebra, computer graphics, animation, robotics, geometry, engineering, and scientific computing.
A point in three-dimensional space is represented by a vector containing three coordinates: x, y, and z. Multiplying this vector by a 3 × 3 matrix produces a new point or vector.
The general 3 × 3 transformation matrix
[ a₂₁ a₂₂ a₂₃ ]
[ a₃₁ a₃₂ a₃₃ ]
[ x′ ] [ x ]
[ y′ ] = A [ y ]
[ z′ ] [ z ]
The transformed coordinates are:
y′ = a₂₁x + a₂₂y + a₂₃z
z′ = a₃₁x + a₃₂y + a₃₃z
Rotation around the X-axis
A rotation around the x-axis changes the y and z coordinates while keeping the x coordinate unchanged.
[ 0 cos θ −sin θ ]
[ 0 sin θ cos θ ]
Rotation around the Y-axis
A rotation around the y-axis changes the x and z coordinates while keeping the y coordinate unchanged.
[ 0 1 0 ]
[ −sin θ 0 cos θ ]
Rotation around the Z-axis
A rotation around the z-axis changes the x and y coordinates while preserving the z coordinate.
[ sin θ cos θ 0 ]
[ 0 0 1 ]
Scaling transformation
Scaling changes the dimensions of a three-dimensional object along its coordinate axes.
[ 0 sᵧ 0 ]
[ 0 0 sᵤ ]
The values sₓ, sᵧ, and sᵤ control the scaling in each direction. Values greater than 1 expand an object, while values between 0 and 1 shrink it. A negative scale factor also reverses the corresponding axis.
Reflection transformation
Reflection produces a mirror image across a coordinate plane. Common reflection matrices include:
[ 0 1 0 ]
[ 0 0 −1 ]
XZ-plane: [ 1 0 0 ]
[ 0 −1 0 ]
[ 0 0 1 ]
YZ-plane: [ −1 0 0 ]
[ 0 1 0 ]
[ 0 0 1 ]
Shear transformation
A 3D shear changes the shape of an object by shifting one coordinate in proportion to another coordinate. For example, a shear in the x-direction based on y uses:
[ 0 1 0 ]
[ 0 0 1 ]
This gives x′ = x + ky. Shear transformations can distort cubes into parallelepipeds and change angles without necessarily changing volume.
Translation and homogeneous coordinates
A 3 × 3 matrix alone cannot translate points because a linear transformation must leave the origin fixed. Translation is added separately as a vector:
A more convenient representation uses homogeneous coordinates. A point (x, y, z) is extended to (x, y, z, 1), allowing translation and linear transformations to be combined into a 4 × 4 matrix:
[ a₂₁ a₂₂ a₂₃ tᵧ ]
[ a₃₁ a₃₂ a₃₃ tᵤ ]
[ 0 0 0 1 ]
The determinant and volume scaling
The determinant of a 3 × 3 matrix describes how the transformation changes three-dimensional volume.
− a₁₂(a₂₁a₃₃ − a₂₃a₃₁)
+ a₁₃(a₂₁a₃₂ − a₂₂a₃₁)
The absolute determinant is the volume scaling factor. A determinant of 1 preserves volume, a determinant with absolute value greater than 1 increases volume, and a value between 0 and 1 reduces volume. A negative determinant reverses orientation. A zero determinant collapses three-dimensional space into a lower-dimensional result.
Combining 3D transformations
Multiple transformations can be combined through matrix multiplication. If B is applied first and A second, the combined transformation is AB:
The order matters because matrix multiplication is generally not commutative. Changing the order of rotation, scaling, and translation can produce a different final position and orientation.
Applications of 3D matrix transformations
- Computer graphics: transforming 3D models and objects.
- Animation: rotating, resizing, and moving digital objects.
- Game development: positioning objects in virtual worlds.
- Robotics: converting between coordinate frames.
- Engineering: analyzing spatial geometry and mechanical systems.
- Scientific visualization: manipulating three-dimensional data.
- CAD: transforming and positioning geometric models.
Frequently asked questions
What is a 3D matrix transformation?
A 3D matrix transformation changes the coordinates of points in three-dimensional space. A 3 × 3 matrix represents linear transformations such as rotation, scaling, reflection, and shear. Translation can be added separately or represented together with the linear transformation using a 4 × 4 homogeneous-coordinate matrix.
What is the difference between a 3 × 3 and a 4 × 4 transformation matrix?
A 3 × 3 matrix transforms three-dimensional vectors through linear operations. A 4 × 4 homogeneous-coordinate matrix can represent affine transformations, including translation, rotation, scaling, reflection, and shear, in one matrix multiplication.
How do you rotate a 3D point around the x-axis?
Rotation around the x-axis by angle θ uses the matrix [[1,0,0],[0,cos θ,−sin θ],[0,sin θ,cos θ]]. It changes the y and z coordinates while leaving the x coordinate unchanged.
How do you rotate a 3D point around the y-axis?
Rotation around the y-axis uses the matrix [[cos θ,0,sin θ],[0,1,0],[−sin θ,0,cos θ]]. It changes the x and z coordinates while preserving the y coordinate.
How do you rotate a 3D point around the z-axis?
Rotation around the z-axis uses the matrix [[cos θ,−sin θ,0],[sin θ,cos θ,0],[0,0,1]]. It rotates the point in the xy-plane while preserving its z coordinate.
What does the determinant of a 3D transformation matrix represent?
The absolute value of the determinant gives the volume scaling factor of the linear transformation. A negative determinant reverses orientation, while a zero determinant means the transformation collapses three-dimensional space into a lower-dimensional result and is not invertible.
Can a 3D matrix transformation include translation?
A 3 × 3 matrix alone cannot translate points because a linear transformation must map the origin to itself. Translation is added as a vector, or included in a 4 × 4 homogeneous-coordinate matrix.
Does the order of 3D matrix transformations matter?
Yes. Matrix multiplication is generally not commutative. Rotating and then translating an object can produce a different result from translating and then rotating it. The order of matrix multiplication must match the intended sequence of operations.
What is a 3D shear transformation?
A 3D shear shifts one coordinate in proportion to another coordinate. For example, x′ = x + ky is represented by a matrix with k in the first row and second column. Shear can change the shape of a solid while preserving its volume when the determinant is 1.
Related matrix calculators and simulators
Explore more interactive tools for matrix operations and transformations.