fresnel.camera¶
Overview
Defines the view into the |
|
Fit a camera to a |
|
Orthographic camera |
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.-
look_at
¶ the point the camera looks at (the center of the focal plane).
-
basis
¶ three orthonormal vectors defining the camera coordinate basis in right-handed order: right, look direction, up (read only)
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.-
-
fresnel.camera.
fit
(scene, view='auto', margin=0.05)¶ Fit a camera to a
Scene
Create a camera that fits the entire height of the scene in the image plane.
- Parameters
scene (
Scene
) – Fit the camera to this scene.view (str) – Select view
margin (float) – Fraction of extra space to leave on the top and bottom of the scene.
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
position (
numpy.ndarray
orarray_like
) – (3
:float32
) - the position of the camera.look_at (
numpy.ndarray
orarray_like
) – (3
:float32
) - the point the camera looks at (the center of the focal plane).up (
numpy.ndarray
orarray_like
) – (3
:float32
) - a vector pointing up.height (float) – the height of the image plane.
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.