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

Pixels and pieces

What this example shows

An orthographic 3D camera measures in the same pixels a sprite does: a model one unit wide is one pixel wide. That is what lets a 3D piece be told to stand on a tile instead of being nudged into place by eye.

With useCamera3d({ follow2d: true }), the 3D camera follows the 2D camera's movement and zoom. The piece uses the board's coordinates, including downward Y: there is no need to subtract it from the screen height or move both cameras by hand. Arrow keys scroll the board, and the piece stays on its tile.

Starting
Starting
—