Chapter 4: Cameras and Lights
Cameras and Lights are the Inventor node classes that allow you to
see the objects that you create in your graph. They are relatively
intuitive; Lights provide the lighting for your scene, while Cameras
provide the viewports to see them from.
Up to Summary of The Inventor Mentor
Back to Chapter 3 - Nodes and Groups
On to
Chapter 5 - Shapes, Properties, and Binding
The Camera class allows you to define a view of the scene. There are
two kinds of Camera nodes: Orthographic and Perspective. The
Orthographic Camera class allows you to define cameras that do not
preserve perspective, which can be useful for designing objects;
Perspective cameras provide a more natural way of viewing scenes.
All Cameras have fields allowing you to set:
- the position of the camera in the scene
- the orientation that the camera faces
- the aspect ratio of the camera
- the near and far clipping planes (so that you don't try to view
things a millimeter away, or off in the extreme distance)
- a focal distance, when relevant
- a mapping flag, for use when the camera's proportions do not match
those of the actual window that the user is looking at.
When a camera is encountered during traversal of a scene graph,
Inventor figures out the volume of "space" that the camera covers
(based on the angles it includes and the clipping planes), and doesn't
draw any objects that aren't in that space. This space is called the
"view volume".
You can orient a camera towards a specific object, using the pointAt()
method, or examine an entire scene using the viewAll() method.
Perspective Cameras provide one additional field: the vertical angle
that the camera covers. By contrast, Orthographic Cameras instead have
a field for the *height* of the volume that the camera should
cover. Thus, Perspective Cameras have (more or less) conical view
volumes, and Orthographic ones have rectangular prisms for their view
volumes.
You can have multiple cameras in a scene, and switch between them
dynamically. However, only one camera may be active at a time, and it
must come before the objects it is to view.
Like Cameras, lights should come before objects in the scene graph,
and each illuminates only the objects that come after it.
There is a base class of Lights, and several subclasses: Point Lights,
Directional Lights, and Spotlights.
All lights have several fields, indicating
- whether the light is on or not
- its intensity
- its color
Point Lights are basically balls of light at a particular point; they
have one additional field, a location, and shine equally in all
directions.
Directional Lights are like sunlight: they are infinitely far off, and
shine in one specific direction. They have one additional field, the
direction of the light.
Spotlights are like real-world spotlights. They have a location in the
scene and a direction of focus, as well as a falloff rate (indicating
how much they are focussed on one spot) and a cutoff angle beyond
which no light goes.
You can have an arbitrary number of lights in a scene.
Author/Summarizer:
Mark Waks
Up to Summary of The Inventor Mentor
Back to Chapter 3 - Nodes and Groups
On to
Chapter 5 - Shapes, Properties, and Binding