Reference setPosition()

setPosition()

Sets the camera’s position in "world" space without changing its orientation.

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

Examples

Syntax

setPosition(x, y, z)

Parameters

x

x-coordinate in "world" space.

y

y-coordinate in "world" space.

z

z-coordinate 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