The LookAt entity allows a Node to view another Node or target position within a 3D scene. The LookAt entity will point the Nodes Z Axis at the target Node or position and maintain focus on that target. Even when the target moves, the LookAt entity will maintain focus and track the target. This is very useful in DriveWorks as it lets you simplify 3D scenes and reduce complex math calculations.
The LookAt entity enables Nodes to follow other Nodes. It can also be used to layout models in a scene by pointing a Node at a selected point in 3D. The LookAt entity is designed to make complex implementations easier.
The example above uses the LookAt entity to follow a cube around a scene. The cube is moved using the Smooth Translate entity. The LookAt entity is also being used to maintain focus on the cube. The Node containing the cone model also has a Node with a spot-light entity applied. This results in the cone and the spot-light following the cube around the scene.
With the Node selected, the LookAt entity will direct a blue arrow or the Z Axis from the current Node to the target Node or position.
With the model Node selected and the LookAt entity added, the following will be displayed in the Information Panel:
Enable and disable the LookAt entity. Disabling the entity will stop the entity where it is and the Node will remain in its current orientation.
Target is the new position or target for the Node to look at. Target can be specified in two ways. You can target another Node in a DriveWorks 3D Document or you can enter the position as a pipe delimited list (X|Y|Z).
1000|2500|500 - X|Y|Z
Use World Position
Use World Position changes the behavior when targeting a position. When targeting a position (X|Y|Z) this property determines if the position is relative to the current Node (local) or to the world space.
Nodes can be parented together and offset from each other in any axis. This will change their overall world position. For example, if you have 4 Nodes parented and offset from each other by 100mm in the X direction, the fourth Node will have a world position of 400mm in the X Axis.
This property lets you set the position of a Node relative to its local or world position, giving you freedom to choose.
Determines if the node will be rotated on the X axis.
Determines if the node will be rotated on the Y axis.
With the model Node selected and the LookAt entity applied, the following will be displayed in the Parameter Panel:
LookAt Enabled controls the enabled state of the LookAt entity. Enter either TRUE or FALSE to control the enabled state of the entity.
Target is the new position or target for the Node to look at. Target can be specified as a Node path or as a 3D position (X|Y|Z).
Use World Position changes the behavior when targeting a position. When targeting a position (X|Y|Z) this property determines if that position is relative to the current Node or to the world space. Enter either TRUE or FALSE.
TRUE - will rotate the node on the X Axis
TRUE - will rotate the node on the Y Axis