Skip to content
Related Articles

Related Articles

p5.js Lights, Camera Complete Reference

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 30 Dec, 2021

Camera() Method: The camera() function sets the camera position for a 3D sketch. Its parameters define the position for the camera, the middle of the sketch (where the camera is pointing), and an up direction (the orientation of the camera).

This function simulates the movements of the camera, allowing objects to be viewed from various angles.

Syntax:

new camera([x], [y], [z], [centerX], [centerY], [centerZ], [upX], [upY], [upZ])

Lights() Function: The lights() function sets the default ambient and directional light. The default values are ambientLight(128, 128, 128) and directionalLight(128, 128, 128, 0, 0, -1)

Syntax:

lights()

Interaction

Lights

Material

Camera

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!