3D Affine Transform Visualizer
Compose 4×4 transforms, inspect matrices, and preview a transformed cube in your browser
About
This visualizer composes ordered 4x4 affine matrices — translation, rotation about X/Y/Z, uniform or per-axis scale, and shear — then applies the combined matrix to the corners of a unit cube so you can see exactly what the transform does. It shows the composed matrix, its determinant, and its inverse (via Gauss-Jordan), plus Euler-rotation matrices in the standard Z*Y*X row-major convention. Everything runs locally: matrix multiplication, inversion, and rendering are pure client-side math with no network requests. Use it to reason about transform order (rotating then translating differs from translating then rotating), verify normals or coordinate conversions, or generate matrices to paste into WebGL, Three.js, or shader code.
Examples
Order changes the result
applyMatrix(composeTransforms([{ translate [2,0,0] }, { rotateZ [90] }]), {1,0,0}) vs reversedx ~2 versus x ~0Rotate-then-translate moves a different point than translate-then-rotate — order is load-bearing.
Inverse restores identity
multiplyMatrices(inverseMatrix(M), M) for translate/rotateY/scale chainthe 4x4 identityA well-formed affine chain times its inverse collapses back to identity within tolerance.
About this tool
Matrix Affine Transform 3D composes 4x4 column-vector matrices with composeTransforms([{ kind, values }]) over translate, rotateX/rotateY/rotateZ (degrees), scale, and skew kinds, backed by translationMatrix, scaleMatrix, rotationX/Y/ZMatrix, skewMatrix, and multiplyMatrices. Points transform with applyMatrix(matrix, vector), which defaults a Vector3 to w = 1 with perspective division.
Analysis helpers include determinant (Gaussian elimination, 0 for singular), inverseMatrix (Gauss-Jordan, throws on singular), identityMatrix, cloneMatrix, eulerRotationMatrix (Z * Y * X order), formatMatrix, plus cubeVertices and transformCube for previews.
Composition order is literal: [translate, rotateZ] multiplies T * R, so the rotation applies to the point first — swapping entries produces a different matrix, and everything is deterministic client-side math.
How to use this tool
List transforms in order
Pass translate/rotate/scale/skew entries — the first entry is the outermost matrix factor.
Apply to points
Call applyMatrix with { x, y, z } (w defaults to 1) or an explicit Vector4.
Invert when needed
Use inverseMatrix for view or undo matrices; catch the singular error on degenerate scales.
Sanity-check with determinant
Confirm scale(2, 3, 4) reads 24 and identity reads 1 before shipping the chain.
Use cases
Building model matrices
Chain scale, rotate, and translate into one matrix for object placement.
Unprojecting points
Invert the composed matrix to map world points back into local space.
Previewing on cubes
Run transformCube to see all eight corners move before touching real geometry.
Common mistakes
Mistake:Reading the transform list as apply-first order.
Fix:[translate, rotate] means T * R, so rotation hits the point first — reverse the array if you want translation applied first.
Mistake:Inverting a matrix with a zero scale axis.
Fix:Any zero scale (e.g. scale(2, 0, 3)) is singular with determinant 0 — give every axis a nonzero size or guard the throw.
Mistake:Passing degrees as radians (or skew values raw).
Fix:Rotations and skews take degrees and convert internally — 90 means a quarter turn, not 90 radians.
Frequently asked questions
What does this tool do?
It composes 4x4 affine matrices with composeTransforms over translate, rotateX/Y/Z (degrees), scale, and skew, applies them with applyMatrix (Vector3 defaults to w = 1), and analyzes them with determinant, inverseMatrix, eulerRotationMatrix, formatMatrix, and transformCube previews.
Does transform order matter?
Yes — [translate, rotateZ] multiplies T * R so rotation applies first, giving a different matrix and point than [rotateZ, translate]. Swap entries deliberately and compare.
Is my geometry uploaded or stored?
No. Composition, inversion, and point transforms are pure client-side math.
Why did inverseMatrix throw?
The matrix is singular (determinant 0) — typically a zero scale axis like scale(2, 0, 3). Restore a nonzero size on every axis or branch around degenerate chains.
Related guides
References & standards
Related tools
ETA Calculator
Estimate finish and arrival times from rate or speed, with any start moment.
Exam & Section Timer
Plan multi-section exams with total duration and seconds-per-question pacing.
Flashcards & Spaced Repetition
Review a flashcard with a transparent SuperMemo SM-2 scheduling algorithm.
GPA & Grade Calculator
Calculate credit-weighted GPA and simulate the semester average needed for a target.
Graph Shortest Path Lab
Build weighted graphs and replay Dijkstra, A*, and Bellman-Ford shortest paths step by step, entirely in your browser.
Interactive Periodic Table
Explore all 118 elements, filter them and preview phase changes by temperature.