How a free camera should fly: what well-known cameras share
You can leave the broadcast view of a game at basketball.casa and fly a free camera around the court. A camera like that is only pleasant if your hands already know it, so its controls were taken from cameras people use elsewhere. This page sets out what those cameras share and what we kept, left out and added.
What the well-known cameras share
The fly camera in the three.js graphics library, the one this site draws with, moves forward and back along the way the camera is looking, with pitch included, and strafes sideways (raw.githubusercontent.com). The scene-view cameras in Unity and Unreal do the same with W and S for forward and back, A and D to strafe, and a pair of keys for down and up, and they make Shift faster and the wheel the camera's speed while flying (docs.unity3d.com, dev.epicgames.com). Only the first-person walker in three.js goes level (raw.githubusercontent.com), and a spectator's camera is not a walker: look down at the court and forward carries you down at it.
What we kept and what we left out
We kept forward along the view, one pair of keys for down and up, a pointer that looks, a limit on how far up or down you can tilt, and Shift for faster. The arrow keys duplicate the movement keys in those editors, but a laptop visitor needs a way to turn more than a second way to move, so here the arrows turn and look instead (below). We left out roll, because a basketball court has an up and a tilted horizon is disorienting, and the right-button look the editors use, because a laptop trackpad has no easy right-drag.
A page is not an editor
An editor owns its window; a web page does not. So the page holds still only while you are flying and keeps scrolling as usual until you click into the game. The browser's pointer lock lets the page read mouse movement with no limit however far the pointer travels, and you leave it with Escape (developer.mozilla.org).
Turning with no mouse
On a laptop a drag is a poor way to turn. Google Earth's keyboard, which runs on pages that are also mouse tools, uses the arrows to move and Shift with the arrows to rotate and tilt the view (support.google.com). The free camera here takes the same idea: Left and Right turn, Up and Down look up and down, Shift turns faster, and a click on the empty court lets the pointer look with no button held, so a laptop visitor can frame a replay without a mouse. W, A, S and D fly and two keys go down and up.
What this is and is not
This is a convention about controls, not a measurement about basketball. It is checked by flying the camera and by tests, never fitted to a number, and when a visitor finds the controls hard we change them.
Sources
- raw.githubusercontent.com https://raw.githubusercontent.com/mrdoob/three.js/r186/examples/jsm/controls/FlyControls.js
- docs.unity3d.com https://docs.unity3d.com/Manual/SceneViewNavigation.html
- dev.epicgames.com https://dev.epicgames.com/documentation/en-us/unreal-engine/viewport-controls-in-unreal-engine
- raw.githubusercontent.com https://raw.githubusercontent.com/mrdoob/three.js/r186/examples/jsm/controls/PointerLockControls.js
- developer.mozilla.org https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API
- support.google.com https://support.google.com/earth/answer/148115?hl=en