3D to 2D projections: A Camera

bewegung includes a pin-hole camera for simple 3D to 2D projections. In a nutshell, the a bewegung.Camera object can convert a bewegung.Vector3D object into a bewegung.Vector2D object given a location and direction in 3D space, i.e. the 3D vector is projected into a plane in 2D space. Because the “camera” is actually not a rendering system on its own, it simply adds meta data (bewegung.Vector.meta) to the returned 2D vector: The absolute distance (meta["dist"]) from the “pinhole” in 3D space to the vector in 3D space. This allows to (manually) implement various kinds of depth perception, e.g. backgrounds and foregrounds, in visualizations. The camera is a useful tool if e.g. multiple drawing backends are combined within a single animation and some kind of common 3D visualization is required. A typical combination is datashader for density distributions and cairo for annotations on top, see gallery for examples.