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.
Notice any errors or typos? Please let us know. Please feel free to edit src/webgl/p5.Camera.js and open a pull request!