A Camera defines a view. It also creates a virtual physical camera object in the scene it is placed in. A Camera looks from the eye point to the target point (the 'view vector'), with the up vector used to define which direction is 'up' in the resulting view.
NOTE: A Camera child must be defined in a 3D world scene, not under a DrawingSheet.
Parameter Rules
autoFit: | Determines whether the view should auto-fit the scene contents. |
Example: | true ; |
cameraType: | One of 'Orthographic' or 'Perspective'. |
Example: | "Orthographic" |
eye: | The point where the camera is located. |
Example: | p(-20,-40,30); |
far: | The distance from the eye to the near-clipping plane. If negative, the system will set this automatically. |
Example: | -1 |
near: | The distance from the eye to the near-clipping plane. If negative, the system will set this automatically. |
Example: | -1 |
showHelper: | If set to true, shows a visible representation of the camera in the scene. |
Example: | false |
target: | The point that the Camera is looking toward. |
Example: | this.TableTopGroup.TableTop0.origin; |
up: | The vector which defines 'up' in the view. Does not need to be orthogonal to the view vector, but must not be parallel to it. |
Example: | v(0,0,1,R.world.transform) |
viewName: | The name of the view modeled by this camera. |
Example: | this.MySheet.TopViewport.viewName; |
Mixins
LayerSelectionMixin
FrameMixin
BaseModel
RULE NAME |
TYPE |
DEFAULTS |
CATEGORY |
FLAGS |
---|---|---|---|---|
autoFit |
boolean |
true |
Input |
Cached |
cameraType |
string |
"Orthographic" |
Input |
Cached |
eye |
point |
p(0,0,1,R.world.transform) |
Input |
Cached |
far |
number |
-1 |
Input |
Cached |
near |
number |
-1 |
Input |
Cached |
showHelper |
boolean |
false |
Input |
Cached |
target |
point |
p(0,0,0,R.world.transform) |
Input |
Cached |
up |
vector |
v(0,1,0,R.world.transform) |
Input |
Cached |
viewName |
string |
"Top" |
Input |
Cached |
Project Example:
In your kBridge Examples Projects folder, open the project called ‘Table’.
Reference Location:
The Camera is used by a Viewport Design. There is a parameter rule in the Viewport Design called camera, from here you reference the Camera design.
In the Example you can review where the Camera design is placed and what values are placed in the Camera parameter rules.
You can also open up the UI, select the 'Show Camera Input?' UICheckBox , set the Model window to 'Sheet1' and change the Eye X, Eye Y, and Eye Z values and watch the view change in the upper right viewPort. You can select from the dropdown menu or type in your value. The Camera Eye text box is just for displaying the Eye value.