All examples · Meshes and 3D · As Markdown, for AIs

Models that follow the 2D camera

What this example shows

useCamera3d({ projection: 'orthographic', follow2d: true }) puts the models in the 2D world: a model at (300, 70) is drawn where a sprite at (300, 70) is, y going down, in the same pixels. The scene's 2D camera moves, turns and zooms both alike, so a 2D game can have pieces built in 3D without placing each one by hand every frame.

The models stay upright and facing as they were built, and a light aimed down still lights them from above. The 3D camera's own x, y and zoom are not read; its z and far are.

Click the preview first so it hears the keyboard. The arrows scroll the level, and each gem stays over its ledge.

Starting
Starting
—