Category
Function
Constructs a camera for viewing an object.
Syntax
camera = AutoCamera(object, direction, width, resolution, aspect, up, perspective, angle, background);
Inputs
Name | Type | Default | Description |
---|---|---|---|
object | object or vector | none | object to be looked at |
direction | vector, string, or object | "front" | position of camera |
width | scalar or object | input dependent | width of field of view |
resolution | integer | 640 | pixels across image |
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 Camera in specifying a direction from which to view a specified object. (Camera specifies a "look-from" point.) It will automatically create an appropriate Camera for a given object for use with Display or Render.
object | is the object for which a camera is to be created. You can specify this parameter as a 3-dimensional position in space. In that case, width must also be explicitly specified (see below) as a numeric value, since the module has no means of estimating object size. | ||||
direction | specifies the direction from the camera eye to the center of the object and can be any of the following strings: "front," "back," "left," "right," "top," "bottom," and their corresponding "off" values ("off-front," "off-back," etc., which are all slightly offset from the direct positions). Hyphens and spaces are not required for the offset (i.e., "offleft" and "off left" are both valid, and Data Explorer ignores capitalization. The direction "front" means from the positive z direction; "back" means from the negative z direction; "left" means from the negative x direction, "top" means from the positive y direction, and so on. Note: This parameter controls only the direction of viewing; it does not allow you inside the object. For interior views, use the ClipPlane or ClipBox module, make the object translucent, or use the Camera module in perspective mode. This parameter can also be specified as a vector to be added to the look-to point. You can use the Direction module for constructing look-from directions. But note that only the direction of the parameter is important; its magnitude does not affect the size of the object in the image. | ||||
width | specifies the width of the image in the units of object. | ||||
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. The default is [0 1 0]. | ||||
perspective | specifies the method of projection used in rendering object. The choices are perspective (0) and orthographic (1).
| ||||
angle | specifies the viewing angle in degrees for perspective projection. | ||||
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
MovingCamera.net PlotLine.net PlotTwoLines.net UsingCompute.net UsingMorph.net
See Also
Camera, Color, Direction, Render, Display
[ OpenDX Home at IBM | OpenDX.org ]