fresnel.camera¶
Overview
fresnel.camera.Camera |
|
fresnel.camera.fit |
|
fresnel.camera.orthographic |
Details
Cameras.
-
class
fresnel.camera.
Camera
(_camera=None)¶ Defines the view into the
Scene
.Use one of the creation functions to create a
Camera
:The camera is a property of the
Scene
. You may read and modify any of these camera attributes.-
position
¶ tuple – the position of the camera (the center of projection).
-
look_at
¶ tuple – the point the camera looks at (the center of the focal plane).
-
up
¶ tuple – a vector pointing up.
-
height
¶ the height of the image plane.
Camera
space is a coordinate system centered on the camera’s position. Positive x points to the right in the image, positive y points up, and positive z points out of the screen.Camera
space shares units withScene
space.TODO: Move description of spaces to an overview page and create figures.
-
-
fresnel.camera.
fit
(scene, view='auto', margin=0.05)¶ Fit a camera to a
Scene
Create a camera that fits the entire hight of the scene in the image plane.
Parameters: view may be ‘auto’, ‘isometric’, or ‘front’.
The isometric view is an orthographic projection from a particular angle so that the x,y, and z directions are equal lengths. The front view is an orthographic projection where +x points to the right, +y points up and +z points out of the screen in the image plane. ‘auto’ automatically selects ‘isometric’ for 3D scenes and ‘front’ for 2D scenes.
-
fresnel.camera.
orthographic
(position, look_at, up, height)¶ Orthographic camera
Parameters: An orthographic camera traces parallel rays from the image plane into the scene. Lines that are parallel in the
Scene
will remain parallel in the rendered image.position is the center of the image plane in
Scene
space. look_at is the point inScene
space that will be in the center of the image. Together, these vectors define the image plane which is perpendicular to the line from position to look_at. Objects in front of the plane will appear in the rendered image, objects behind the plane will not.up is a vector in
Scene
space that defines which direction points up (+y direction in the image). up does not need to be perpendicular to the line from position to look_at, but it must not be parallel to that line. height sets the height of the image inScene
units. The image width is determined by the aspect ratio of the image. The area width by height about the look_at point will be included in the rendered image.TODO: show a figure