Reference lookAt()

lookAt()

Points the camera at a location.

myCamera.lookAt() changes the camera’s orientation without changing its position.

The parameters, x, y, and z, are the coordinates in "world" space where the camera should point. For example, calling myCamera.lookAt(10, 20, 30) points the camera at the coordinates (10, 20, 30).

Examples

Syntax

lookAt(x, y, z)

Parameters

x
Number:

x-coordinate of the position where the camera should look in "world" space.

y
Number:

y-coordinate of the position where the camera should look in "world" space.

z
Number:

z-coordinate of the position where the camera should look in "world" space.

This page is generated from the comments in src/webgl/p5.Camera.js . Please feel free to edit it and submit a pull request!

Related References