ScratchData LogoScratchData
Back to tdk3's profile

Rotating Cube | 3D -> 2D projection

TDtdk3•Created October 12, 2023
Rotating Cube | 3D -> 2D projection
1
1
7 views
View on Scratch

Instructions

Just a simple spinning cube, projected from a 3D point, onto a 2D screen. -- Math: Projection: 2D -> ((x * cos(angle)) + (z * sin(angle)), y) X Axis: |1 0 0| |x| | x | |x'| |0 cos θ −sin θ| |y| = |y cos θ − z sin θ | = |y'| |0 sin θ cos θ| |z| |y sin θ + z cos θ | |z'| Y Axis: | cos θ 0 sin θ | |x| | x cos θ + z sin θ | |x'| | 0 1 0| |y| = | y | = |y'| |−sin θ 0 cos θ| |z| |−x sin θ + z cos θ| |z'| Z Axis: |cos θ −sin θ 0| |x| |x cos θ − y sin θ| |x'| |sin θ cos θ 0| |y| = |x sin θ + y cos θ| = |y'| | 0 0 1| |z| | z | |z'|

Description

math :) i messed up a few points on the cube, but i decided to keep it as a way to show the sides

Project Details

Project ID907061340
CreatedOctober 12, 2023
Last ModifiedOctober 18, 2023
SharedOctober 13, 2023
Visibilityvisible
CommentsAllowed