3D Visualization
Rotate and zoom a three-dimensional object.
Question
How can matrices rotate, resize, move, and display a three-dimensional object?
Goals
- Build matrix transformations for a 3D model.
- Create interactive rotation and zoom with a screen projection.
Method
Store the object as coordinates and transform every point with matrices.
- Represent vertices and edges in homogeneous coordinates.
- Multiply by rotation, scaling, translation, camera, and projection matrices.
- Render the transformed points and connect controls for rotation and zoom.
Try an example
Rotate!
A playable example that applies rotation matrices and scaling to a wireframe torus.
Controls: Press Enter. Use W/S, Q/E, and A/D for the three rotation axes; use Up/Down to zoom.