File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -170,3 +170,23 @@ defined by a composition of a translation and a linear transformation. An
170170(and controllable) if you construct it from a composition of a linear map
171171and a translation, e.g. ` Translation(v) ∘ LinearMap(v) ` (or any combination of
172172` LinearMap ` , ` Translation ` and ` AffineMap ` ).
173+
174+ #### Perspective transformations
175+
176+ The perspective transformation maps real-space coordinates to those on a virtual
177+ "screen" of one lesser dimension. For instance, this process is used to render
178+ 3D scenes to 2D images in computer generated graphics and games. It is an ideal
179+ model of how a pinhole camera operates and is a good approximation of the modern
180+ photography process.
181+
182+ The ` PerspectiveMap() ` command creates a singleton ` Transformation ` to perform
183+ the projective mapping. It can be applied individually, but is particularly
184+ powerful when composed with an ` AffineMap ` containing the position and
185+ orientation of the camera in your scene. For example, to transfer ` points ` in 3D
186+ space to 2D ` screen_points ` giving their projected locations on a virtual camera
187+ image, you might use the following code:
188+
189+ ``` julia
190+ cam_transform = PerspectiveMap () ∘ AffineMap (cam_rotation, - cam_position)
191+ screen_points = map (cam_transform, points)
192+ ```
You can’t perform that action at this time.
0 commit comments