Reference+
Name
normal()
Description
Sets the current normal vector. Used for drawing three-dimensional shapes and surfaces, normal() specifies a vector perpendicular to a shape's surface which, in turn, determines how lighting affects it. Processing attempts to automatically assign normals to shapes, but since that's imperfect, this is a better option when you want more control. This function is identical to glNormal3f() in OpenGL.
Examples
size(400, 400, P3D); noStroke(); background(0); pointLight(150, 250, 150, 40, 120, 200); beginShape(); normal(0, 0, 4); vertex(80, 80, -40); vertex(320, 80, 40); vertex(320, 320, -40); vertex(80, 320, 40); endShape(CLOSE);
Syntax
normal(nx, ny, nz)
Parameters
nx
(float)
x directionny
(float)
y directionnz
(float)
z direction
Return
void
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.