- Processing
- p5.js
- Processing.py
- Processing for Android
- Processing for Pi

- Processing Foundation

This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

Name | ### normal()
Examples |
    size(100, 100, P3D);
    noStroke();
    background(0);
    pointLight(150, 250, 150, 10, 30, 50);
    beginShape();
    normal(0, 0, 1);
    vertex(20, 20, -10);
    vertex(80, 20, 10);
    vertex(80, 80, -10);
    vertex(20, 80, 10);
    endShape(CLOSE);
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.
Syntax |
    normal(nx, ny, nz)
Parameters |
nx | float: x direction
ny | float: y direction
nz | float: z direction
Returns | void
Related | beginShape() endShape() lights()

Updated on January 1, 2021 03:38:07am EST
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.