Vizard 8 » Command Index » Vizard objects » node3d » <node3d>.lookAt
8.0

<node3d>.lookAt

Have the node look at a certain point

<node3d>.lookAt(  
point  
roll = 0.0  
mode = viz.ABS_PARENT  
)  
point
The [x,y,z] point the object should face.
roll = 0.0
The roll amount to apply to the rotation, in degrees.
mode = viz.ABS_PARENT
Can be one of the following:

Transform modes

viz.ABS_PARENT

Perform the transformation absolutely in the parents coordinate system.

viz.ABS_GLOBAL

Perform the transformation absolutely in world coordinates.

viz.REL_LOCAL
viz.ABS_LOCAL

Perform the transformation in the objects local coordinates system.

viz.REL_PARENT

Perform the transformation relatively in the parents coordinate system.

viz.REL_GLOBAL

Perform the transformation relatively in the global coordinate system.

Remarks

This command will rotate the object so that it is facing the given point based on its current position.

Return Value

None

Example

import vizshape
arrow = vizshape.addArrow(color=viz.YELLOW)
arrow.lookAt([4,5,6]) # Have the arrow point at [4,5,6]

See also

<node3d>.setAxisAngle
<node3d>.setEuler
<node3d>.setMatrix
<node3d>.setQuat