All examples · Meshes and 3D

Two cameras

What this example shows

The 2D and 3D layers look through different cameras, and neither can reach the other layer. WASD moves the 3D camera and only the cubes shift; the arrows move the 2D camera, in pixels, and only the markers shift.

The readout lives in an object that calls useScreenSpace(), so it ignores the 2D camera as well and never moves at all. A scene that declares no useCamera2d draws all its 2D that way, which is what a HUD over a 3D world wants.

Starting