KvadrantCamera

How far the eye is from the drawing plane, for everything in this library that turns in 3D.

GraphicsLayerScope.cameraDistance places the camera at a fixed number of pixels — measured at value * 72 px on both skiko and hwui — while every piece of geometry handed to it is in dp. Left alone, that makes the perspective a property of the screen: on a 2.625x device a 100 dp tile subtends 0.456 of a 576 px camera where the same tile subtends 0.174 on a desktop, so it turns visibly harder there. Holding the distance in dp and converting per density removes that, and the default reproduces Compose's own camera exactly at density 1 — so nothing about the desktop moves.

It lives in one place because it was in six: the tilt, both turnstiles, the tile flip, the swivel transition and the looping selector each wrote cameraDistance = 8f, and fixing the tilt alone left five surfaces turning by a different rule from the one they share a screen with.

Properties

Link copied to clipboard

Compose's own default camera restated in dp: 8 * 72 = 576 px at density 1.