DriveWorks Pro 18: LookAt Entity [send feedback...]

LookAt Entity

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.

animated gif showing the look at entity

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.

image showing a 3D triad

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.

Information Panel

With the model Node selected and the LookAt entity added, the following will be displayed in the Information Panel:

image showing the properties available for the look at entity

LookAt Enabled

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

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).

  • Target a Node

    Root\Model\Model-1

  • Target a Position

    1000|2500|500 - X|Y|Z

When the Target is left blank or has an invalid input, the Nodes rotation will not be affected until a valid input has been provided.

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.

Parameter Panel

With the model Node selected and the LookAt entity applied, the following will be displayed in the Parameter Panel:

  • LookAt Enabled

    LookAt Enabled controls the enabled state of the LookAt entity. Enter either TRUE or FALSE to control the enabled state of the entity.

  • Target

    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

    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.

Please see VectorLookAt. for using LookAt as a function in a rule.
Please see Get LookAt Rotation for more information on running LookAt as a task

Table of Contents