Fundamentals of Creating Motion Using Cameras and Viewports
Viewports and cameras are central parts of all applications created in EON authoring software. The Camera frame is present in all applications and it allows you to walk around an environment just as you would in the real world. The Simulation Tree window is a primary viewport that could be described as the screen where you view all actions taking place in the application. You can have multiple viewports that provide additional looks at the models from different angles or to guide a simulation with additional information.
The first thing to remember is that the field of view is called a viewport which is made up of the area that can be viewed by the camera. The Simulation Window can show several viewports at the same time. A Viewport node defines a rectangular viewing region that shows a view of the scene in the Simulation Window. The Viewport node must be connected to a Camera node, defining the viewpoint of this viewport.
The viewport is made up of camera reference information and property information for the field of view. This 3D viewport displays the current camera view of scene objects in a three-dimensional environment and allows you to move and rotate around all three axes to view the model from different angles. The Viewport3 node
is a default frame in the simulation tree that contains SFField nodes
that appear as folders in the Viewport3 node Frame.
SFNode datatype are used to hold node references. When you create a field or an exposed field with the SFNode data type, you will see a yellow folder appear under the Script node. To place a node reference on one of these fields, you simply use the Copy as Link and Paste methods to place a shortcut to the node in the yellow folder beneath the Script node.
By default, there is a Viewport3 Node that works in tandem with the Camera node referenced in the Viewport node’s Camera SFField. However, the Simulation Window can contain multiple viewports that can be overlaid on top of one another or placed on specific locations in the simulation area. In the Viewports folder, additional Viewport3 nodes can be placed for multiple view simulations.
Cameras are frame nodes that hold position and orientation information. Then, this information is passed on to the Viewport node. A camera (i.e., Frame node) can be moved around the scene dynamically to adjust the viewing perspective for the simulation by using motion nodes that move their parent frame including the Place node, KeyFrame node, Walk node, WalkAbout node, and others. A camera can also be manually adjusted, although this method is not preferred.
Creating Camera Views
If you want to set the camera positon to your current location, click the Set Initial View button on the Zoom Extents Bar. Your current camera view will be displayed the next time you open the simulation.
Camera views can be created by adding Motion Model nodes below the Camera frame. These nodes modify the position and orientation of the camera. A series of Place nodes can be placed below the Camera frame to create multiple camera views.
A Viewport3 node defines the user’s field of view and how the simulation played in the Simulation Window. The Viewport node must be connected to a Frame node defining the user’s position and orientation in the simulation. The following are some of the properties that are manageable in the Viewport Node:
- Camera: The Camera contains the Position and Orientation fields that provide values for the Viewport node to render the 3D perspective of the viewing area. The Camera SFField contains a Camera node, which is a Frame node that is linked to a Viewport3 node. The Camera Node’s Position and Orientation fields, the field of view, and the near and far clipping plane settings determine what the viewer sees in the simulation window.
- RenderTree: The RenderTree refers to the objects that will be rendered in the viewport. If the RenderTree field contains a reference to another node, only the objects under that node will be displayed in that viewport. If the RenderTree field is blank, everything will render.
- Target: If this field assigned (with a reference to a RenderTexture node), the output of this viewport is sent to a texture image instead of the display screen. This can be used to implement multi-pass rendering effects, in conjunction with custom shaders.
- TargetCubeMapSide: If you render to a cubemap texture, by setting the Target to a RenderTexture node of Cubemap type, you need to specify which side on this cubemap texture you want to render this viewport into.
- The RenderTexture node, which holds the texture image, can either be a 2D or a cubemap texture, of arbitrary size.
- Background Texture: If this field is assigned with a reference to a texture node (e.g., Texture2, RenderTexture, MovieTexture), the texture will be rendered as a backdrop for the viewport. Using Cameras to Create Motion and Viewports.
- Pickable: This field determines whether this viewport reacts to mouse picking or not. For instance, if you have a transparent viewport on top of another viewport, you will want set this field on the top viewport to false, so that the mouse click will not be blocked by the top viewport, and thus the user can click through and pick objects in the underlying viewport.
The properties of the Viewport3 node allow you to specify a rectangular portion of the Simulation Window. The Viewport3 node’s port can be thought of as a portal—a window through which you view a certain portion of the 3D world. The Viewport node’s settings also define the viewing frustum, which is the shape of the 3D space defined by a field of view and near and far clipping planes. The Viewport node’s properties determine where the viewport is positioned in the Simulation Window and which objects are displayed in the viewport window based on the camera’s viewing area and distance from the objects that could be displayed.
- Position: The position fields, X and Y, identify the X and Y, start position relative to the upper left corner of the simulation window. This field determines the viewport’s relative position in the simulation window. The values can range from zero to one. The position (0,0) is located at the upper left corner, and (0.5,0.5) is located at the center of the window.
- Size: The size values, Width and Height, determine the viewport’s relative size in the simulation window. The values can range from zero to one. A Width value of 0.5 sets the viewport to half of the simulation window’s width.
- Clipping Planes: Clipping planes, which are perpendicular to the camera, occupy the entire viewport. They can be used to prevent the processing of objects that are not within clear sight, thus preserving processing resources. Objects that are farther away than the distance of the far clipping plane are not drawn see Fig 56
Objects closer than the distance of the near clipping plane are not drawn.
- Field of View: The field of view value, which is stored in the FieldOfView field, determines the viewer’s field of view in degrees. The default value is 53 degrees. For simulations of building interiors, 53 degrees is too narrow. If you broaden the field of view to 75 degrees, for example, the new field of view will allow you to see up to three walls of a room at the same time. The viewport perspective is altered, and you can now see more objects.
All of a Viewport node’s properties affect the frame rate of the simulation. The more objects that are visible at any given time, the more calculations the computer must perform. For maximum performance, keep the far clipping plane near, the near clipping plane far, and the field of vision narrow.