ScratchData LogoScratchData
Back to RoboSquid's profile

Spinning Cube with perspective/hidden faces

RORoboSquid•Created February 9, 2015
Spinning Cube with perspective/hidden faces
18
10
274 views
View on Scratch

Instructions

A quick experiment with 3D graphics - just run for a tumbling 3D cube. Space-key starts/stops random tumble. T-Key alters tumble direction. Arrow keys to manually rotate. P-key cycles through perspective settings (off/close VP/distant VP). H-key toggles hidden face removal.

Description

All code my own. Simple vanishing point perspective and cross-product of diagonals of faces used to generate normals to determine hidden faces. Occasional glitch in hidden face removal in more pronounced perspective setting. Not got my head round that yet. If you're digging into the code the +ve z-axis goes into the screen - so the co-ordinate system is left-handed.

Project Details

Project ID47178606
CreatedFebruary 9, 2015
Last ModifiedFebruary 9, 2015
SharedFebruary 9, 2015
Visibilityvisible
CommentsAllowed