Category
Function
Constructs a camera for viewing an object.
Syntax
camera = Camera(to, from, width, resolution, aspect, up, perspective, angle, background);
Inputs
Name | Type | Default | Description |
---|---|---|---|
to | vector or object | [0 0 0] | look-to point |
from | vector or object | [0 0 1] | position of camera |
width | scalar or object | 100 | width of field of view (for orthographic projection) |
resolution | integer | 640 | horizontal resolution of image (in pixels) |
aspect | scalar | 0.75 | height/width |
up | vector | [0 1 0] | up direction |
perspective | flag | 0 | 0: orthographic projection
1: perspective projection |
angle | scalar | 30.0 | view angle (in degrees) (for perspective projection) |
background | vector or string | "black" | image background color |
Outputs
Name | Type | Description |
---|---|---|
camera | camera | resulting camera |
Functional Details
This module differs from AutoCamera in that it specifies a "look-from" point for viewing an object (AutoCamera specifies a direction from which to view an object).
to | specifies a point in the scene that appears at the center of the image; the default is the origin of world space. This parameter can also be specified as an object, in which case the center of the object serves as the look-to point. Note: This parameter cannot have the same value as from (see below). | ||||
from | specifies the location of the camera; the default is [0 0 1]. This parameter can also be specified as an object, in which case its value is the center of the object's bounding box. Note: This parameter cannot have the same value as to (see above). | ||||
width | functions only for an orthographic projection (see perspective below). It specifies the width of the field of view, in world coordinates. If this parameter is specified as an object, the module uses a value that is slightly larger than the diagonal of the object's bounding box. | ||||
resolution | specifies the width of the image in pixels. | ||||
aspect | specifies the height-to-width ratio of the image. | ||||
up | specifies a vector that will be aligned with the vertical axis of the image. | ||||
perspective | specifies the method of projection used in rendering object: perspective (0) or orthographic (1).
| ||||
angle | specifies the viewing angle in degrees. The vertex of this angle is to. | ||||
background | specifies the color of the image background as either an RGB color or a color-name string. The string can be any of the defined color-name strings (see Color). |
Example Visual Programs
FlyThrough.net (uses the macro InterpolatePositionsMacro.net) FlyThrough2.net
See Also
AutoCamera, AutoColor, Direction, Render
[Data Explorer Home Page | Contact Data Explorer | Same document on Data Explorer Home Page ]