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

Models in a 2D scene

What this example shows

useCamera3d() is orthographic by default and measures in the game's pixels, so a model can sit exactly where a sprite is. Its origin is the bottom-left corner and y grows up, so a model goes where a sprite is with y3d = H - y2d; and it sees as far behind the camera as in front, so models around z = 0 are drawn.

A gem floats over a path written in 2D coordinates, with a 2D shadow under it; a crate sits on the floor at a 2D point; and a sprite pillar is drawn in front of the gem, because zIndex sorts models and sprites in one list.

Starting
Starting
—