All examples · Meshes and 3D

A cube

What this example shows

A model is a shape, a place and a surface. useCubeGeometry builds the shape and shares it; createMesh puts one somewhere, the way createSprite does with a picture.

The light is worked out at the corners and smeared across each face in between, which is what the consoles of this era did: none of them lit per pixel. Watch the faces shade differently as it turns, and note there is no texture on it at all.

Starting