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

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

y

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

z

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

Notice any errors or typos? Please let us know. Please feel free to edit src/webgl/p5.Camera.js and open a pull request!

Related References