PGraphics2D

processing.opengl

## Class PGraphics2D

- java.lang.Object
- - processing.core.PImage
  - - processing.core.PGraphics
    - - processing.opengl.PGraphicsOpenGL
      - - processing.opengl.PGraphics2D

- All Implemented Interfaces:
    Cloneable, PConstants

      public class PGraphics2D
      extends PGraphicsOpenGL

- - ### Field Summary

    - ### Fields inherited from class processing.opengl.PGraphicsOpenGL

      `anisoSamplingSupported, autoMipmapGenSupported, blendEqSupported, camera, cameraAspect, cameraFar, cameraFOV, cameraInv, cameraNear, cameraX, cameraY, cameraZ, currentLightFalloffConstant, currentLightFalloffLinear, currentLightFalloffQuadratic, currentLightSpecular, depthBits, fboMultisampleSupported, glLineAttrib, glLineColor, glLineIndex, glLineVertex, glPointAttrib, glPointColor, glPointIndex, glPointVertex, glPolyAmbient, glPolyColor, glPolyEmissive, glPolyIndex, glPolyNormal, glPolyShininess, glPolySpecular, glPolyTexcoord, glPolyVertex, GLSL_VERSION, initialized, lightAmbient, lightCount, lightDiffuse, lightFalloffCoefficients, lightNormal, lightPosition, lights, lightSpecular, lightSpotParameters, lightType, maxAnisoAmount, maxSamples, maxTextureSize, modelview, modelviewInv, npotTexSupported, OPENGL_EXTENSIONS, OPENGL_RENDERER, OPENGL_VENDOR, OPENGL_VERSION, packedDepthStencilSupported, pgl, projection, projmodelview, stencilBits`

    - ### Fields inherited from class processing.core.PGraphics

      `A, AB, AG, ambientB, ambientColor, ambientG, ambientR, AR, B, backgroundColor, BEEN_LIT, bezierDetail, canvas, colorMode, colorModeA, colorModeX, colorModeY, colorModeZ, curveDetail, curveTightness, DA, DB, DEFAULT_VERTICES, DG, DR, EB, edge, EDGE, EG, ellipseMode, emissiveB, emissiveColor, emissiveG, emissiveR, ER, fill, fillColor, G, HAS_NORMAL, image, imageMode, normalX, normalY, normalZ, NX, NY, NZ, pixelCount, quality, R, rectMode, SA, SB, setAmbient, SG, shapeMode, SHINE, shininess, smooth, SPB, specularB, specularColor, specularG, specularR, SPG, sphereDetailU, sphereDetailV, SPR, SR, stroke, strokeCap, strokeColor, strokeJoin, strokeWeight, SW, textAlign, textAlignY, textFont, textLeading, textMode, textSize, textureImage, textureMode, textureU, textureV, tint, tintColor, TX, TY, TZ, U, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ`

    - ### Fields inherited from class processing.core.PImage

      `ALPHA_MASK, BLUE_MASK, format, GREEN_MASK, height, loaded, parent, pixels, RED_MASK, width`

    - ### Fields inherited from interface processing.core.PConstants

      `ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_RETINA_PIXELS, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_RETINA_PIXELS, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPHERE, SPOT, SQUARE, SUBTRACT, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PGraphics2D()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `ambientLight(float red, float green, float blue)` Add an ambient light based on the current color mode.
    `void` | `ambientLight(float red, float green, float blue, float x, float y, float z)` Add an ambient light based on the current color mode.
    `void` | `applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)` Apply a 4x4 transformation matrix to the modelview stack.
    `void` | `applyMatrix(PMatrix3D source)`
    `void` | `beginCamera()` Set matrix mode to the camera matrix (instead of the current transformation matrix).
    `void` | `bezierVertex(float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)` ( begin auto-generated from bezierVertex.xml ) Specifies vertex coordinates for Bezier curves.
    `void` | `box(float w, float h, float d)`
    `void` | `camera()` Set camera to the default settings.
    `void` | `camera(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)` More flexible method for dealing with camera().
    `PShape` | `createShape()`
    `PShape` | `createShape(int type)`
    `PShape` | `createShape(int kind, float... p)`
    `PShape` | `createShape(PShape source)`
    `void` | `curveVertex(float x, float y, float z)`
    `void` | `directionalLight(float red, float green, float blue, float nx, float ny, float nz)` ( begin auto-generated from directionalLight.xml ) Adds a directional light.
    `void` | `endCamera()` Record the current settings into the camera matrix, and set the matrix mode back to the current transformation matrix.
    `void` | `frustum(float left, float right, float bottom, float top, float znear, float zfar)` Same as glFrustum(), except that it wipes out (rather than multiplies against) the current perspective matrix.
    `PMatrix3D` | `getMatrix(PMatrix3D target)` Copy the current transformation matrix into the specified target.
    `void` | `hint(int which)` ( begin auto-generated from hint.xml ) Set various hints and hacks for the renderer.
    `boolean` | `is2D()` Return true if this renderer supports 2D drawing.
    `boolean` | `is3D()` Return true if this renderer supports 3D drawing.
    `void` | `lightFalloff(float constant, float linear, float quadratic)` Set the light falloff rates for the last light that was created.
    `void` | `lights()` Sets up an ambient and directional light using OpenGL.
    `void` | `lightSpecular(float v1, float v2, float v3)` Set the specular color of the last light created.
    `void` | `noLights()` Disables lighting.
    `void` | `ortho()` Calls ortho() with the proper parameters for Processing's standard orthographic projection.
    `void` | `ortho(float left, float right, float bottom, float top)` Calls ortho() with the specified size of the viewing volume along the X and Z directions.
    `void` | `ortho(float left, float right, float bottom, float top, float near, float far)` Sets an orthographic projection.
    `void` | `perspective()` Calls perspective() with Processing's standard coordinate projection.
    `void` | `perspective(float fov, float aspect, float zNear, float zFar)` Similar to gluPerspective().
    `void` | `pointLight(float red, float green, float blue, float x, float y, float z)` ( begin auto-generated from pointLight.xml ) Adds a point light.
    `void` | `quadraticVertex(float x2, float y2, float z2, float x4, float y4, float z4)`
    `void` | `rotate(float angle, float vx, float vy, float vz)` Rotate around an arbitrary vector, similar to glRotate(), except that it takes radians (instead of degrees).
    `void` | `rotateX(float angle)` ( begin auto-generated from rotateX.xml ) Rotates a shape around the x-axis the amount specified by the angle parameter.
    `void` | `rotateY(float angle)` ( begin auto-generated from rotateY.xml ) Rotates a shape around the y-axis the amount specified by the angle parameter.
    `void` | `rotateZ(float angle)` ( begin auto-generated from rotateZ.xml ) Rotates a shape around the z-axis the amount specified by the angle parameter.
    `void` | `scale(float sx, float sy, float sz)` Scale in three dimensions.
    `float` | `screenX(float x, float y, float z)`
    `float` | `screenY(float x, float y, float z)`
    `float` | `screenZ(float x, float y, float z)` ( begin auto-generated from screenZ.xml ) Takes a three-dimensional X, Y, Z position and returns the Z value for where it will appear on a (two-dimensional) screen.
    `void` | `setMatrix(PMatrix3D source)` Set the current transformation to the contents of the specified source.
    `void` | `shape(PShape shape)`
    `void` | `shape(PShape shape, float x, float y)` ( begin auto-generated from shape.xml ) Displays shapes to the screen.
    `void` | `shape(PShape shape, float x, float y, float z)`
    `void` | `shape(PShape shape, float a, float b, float c, float d)`
    `void` | `shape(PShape shape, float x, float y, float z, float c, float d, float e)`
    `void` | `sphere(float r)` ( begin auto-generated from sphere.xml ) A sphere is a hollow ball made from tessellated triangles.
    `void` | `spotLight(float red, float green, float blue, float x, float y, float z, float nx, float ny, float nz, float angle, float concentration)` ( begin auto-generated from spotLight.xml ) Adds a spot light.
    `void` | `translate(float tx, float ty, float tz)`
    `void` | `vertex(float x, float y, float z)`
    `void` | `vertex(float x, float y, float z, float u, float v)` ( begin auto-generated from vertex.xml ) All shapes are constructed by connecting a series of vertices.

    - ### Methods inherited from class processing.opengl.PGraphicsOpenGL

      `applyMatrix, applyMatrix, applyProjection, applyProjection, beginContour, beginDraw, beginPGL, beginReadPixels, beginShape, bezierVertex, camera, canDraw, copy, copy, curveVertex, dispose, ellipseImpl, endContour, endDraw, endPGL, endReadPixels, endShape, filter, filter, filter, flush, get, getMatrix, getTexture, getTexture, isGL, line, line, loadPixels, loadShader, loadShader, loadShape, loadTexture, mask, modelX, modelY, modelZ, noClip, noSmooth, point, point, popMatrix, popProjection, popStyle, printCamera, printMatrix, printProjection, pushMatrix, pushProjection, quad, quadraticVertex, report, requestDraw, requestFocus, resetMatrix, resetProjection, resetShader, resetShader, resize, rotate, scale, scale, screenX, screenY, set, setFrameRate, setMatrix, setPrimary, setProjection, setSize, shader, shader, shearX, shearY, smooth, smooth, strokeCap, strokeJoin, strokeWeight, textAscent, textDescent, textSize, textureSampling, textureWrap, translate, triangle, updateDisplay, updateProjmodelview, updateTexture, updateTexture, vertex, vertex`

    - ### Methods inherited from class processing.core.PGraphics

      `alpha, ambient, ambient, ambient, applyMatrix, arc, arc, background, background, background, background, background, background, background, beginRaw, beginShape, bezier, bezier, bezierDetail, bezierPoint, bezierTangent, blendMode, blue, box, brightness, clear, clip, color, color, color, color, color, color, color, color, color, colorMode, colorMode, colorMode, colorMode, curve, curve, curveDetail, curvePoint, curveTangent, curveTightness, displayable, edge, ellipse, ellipseMode, emissive, emissive, emissive, endRaw, endShape, fill, fill, fill, fill, fill, fill, getCache, getMatrix, getRaw, getStyle, getStyle, green, haveRaw, hue, image, image, image, imageMode, lerpColor, lerpColor, loadShape, noFill, normal, noStroke, noTexture, noTint, pushStyle, rect, rect, rect, rectMode, red, removeCache, saturation, setCache, setMatrix, setParent, setPath, shapeMode, shininess, showDepthWarning, showDepthWarningXYZ, showException, showMethodWarning, showMissingWarning, showVariationWarning, showWarning, showWarning, specular, specular, specular, sphereDetail, sphereDetail, stroke, stroke, stroke, stroke, stroke, stroke, style, text, text, text, text, text, text, text, text, text, text, text, textAlign, textAlign, textFont, textFont, textLeading, textMode, texture, textureMode, textWidth, textWidth, textWidth, tint, tint, tint, tint, tint, tint, vertex`

    - ### Methods inherited from class processing.core.PImage

      `blend, blend, blendColor, clone, get, get, getImage, getModifiedX1, getModifiedX2, getModifiedY1, getModifiedY2, getNative, init, isLoaded, isModified, mask, save, set, setLoaded, setLoaded, setModified, setModified, updatePixels, updatePixels`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PGraphics2D

          public PGraphics2D()

  - ### Method Detail

    - #### is2D

          public boolean is2D()

      Description copied from class: `PGraphics`
      Return true if this renderer supports 2D drawing. Defaults to true.
      Overrides:
        `is2D` in class `PGraphics`

    - #### is3D

          public boolean is3D()

      Description copied from class: `PGraphics`
      Return true if this renderer supports 3D drawing. Defaults to false.
      Overrides:
        `is3D` in class `PGraphics`

    - #### hint

          public void hint(int which)

      Description copied from class: `PGraphics`
      ( begin auto-generated from hint.xml ) Set various hints and hacks for the renderer. This is used to handle obscure rendering features that cannot be implemented in a consistent manner across renderers. Many options will often graduate to standard features instead of hints over time.
      hint(ENABLE_OPENGL_4X_SMOOTH) - Enable 4x anti-aliasing for P3D. This can help force anti-aliasing if it has not been enabled by the user. On some graphics cards, this can also be set by the graphics driver's control panel, however not all cards make this available. This hint must be called immediately after the size() command because it resets the renderer, obliterating any settings and anything drawn (and like size(), re-running the code that came before it again).
      hint(DISABLE_OPENGL_2X_SMOOTH) - In Processing 1.0, Processing always enables 2x smoothing when the P3D renderer is used. This hint disables the default 2x smoothing and returns the smoothing behavior found in earlier releases, where smooth() and noSmooth() could be used to enable and disable smoothing, though the quality was inferior.
      hint(ENABLE_NATIVE_FONTS) - Use the native version fonts when they are installed, rather than the bitmapped version from a .vlw file. This is useful with the default (or JAVA2D) renderer setting, as it will improve font rendering speed. This is not enabled by default, because it can be misleading while testing because the type will look great on your machine (because you have the font installed) but lousy on others' machines if the identical font is unavailable. This option can only be set per-sketch, and must be called before any use of textFont().
      hint(DISABLE_DEPTH_TEST) - Disable the zbuffer, allowing you to draw on top of everything at will. When depth testing is disabled, items will be drawn to the screen sequentially, like a painting. This hint is most often used to draw in 3D, then draw in 2D on top of it (for instance, to draw GUI controls in 2D on top of a 3D interface). Starting in release 0149, this will also clear the depth buffer. Restore the default with hint(ENABLE_DEPTH_TEST), but note that with the depth buffer cleared, any 3D drawing that happens later in draw() will ignore existing shapes on the screen.
      hint(ENABLE_DEPTH_SORT) - Enable primitive z-sorting of triangles and lines in P3D and OPENGL. This can slow performance considerably, and the algorithm is not yet perfect. Restore the default with hint(DISABLE_DEPTH_SORT).
      hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the P3D renderer setting by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
      As of release 0149, unhint() has been removed in favor of adding additional ENABLE/DISABLE constants to reset the default behavior. This prevents the double negatives, and also reinforces which hints can be enabled or disabled. ( end auto-generated )
      Overrides:
        `hint` in class `PGraphicsOpenGL`
      Parameters:
        `which` - name of the hint to be enabled or disabled
      See Also:
        `PGraphics`, `PApplet.createGraphics(int, int, String, String)`, `PApplet.size(int, int)`

    - #### ortho

          public void ortho()

      Description copied from class: `PGraphicsOpenGL`
      Calls ortho() with the proper parameters for Processing's standard orthographic projection.
      Overrides:
        `ortho` in class `PGraphicsOpenGL`

    - #### ortho

          public void ortho(float left,
                   float right,
                   float bottom,
                   float top)

      Description copied from class: `PGraphicsOpenGL`
      Calls ortho() with the specified size of the viewing volume along the X and Z directions.
      Overrides:
        `ortho` in class `PGraphicsOpenGL`
      Parameters:
        `left` - left plane of the clipping volume
        `right` - right plane of the clipping volume
        `bottom` - bottom plane of the clipping volume
        `top` - top plane of the clipping volume

    - #### ortho

          public void ortho(float left,
                   float right,
                   float bottom,
                   float top,
                   float near,
                   float far)

      Description copied from class: `PGraphicsOpenGL`
      Sets an orthographic projection.
      Overrides:
        `ortho` in class `PGraphicsOpenGL`
        `near` - maximum distance from the origin to the viewer
        `far` - maximum distance from the origin away from the viewer

    - #### perspective

          public void perspective()

      Description copied from class: `PGraphicsOpenGL`
      Calls perspective() with Processing's standard coordinate projection.

      Projection functions:

      - frustrum()
      - ortho()
      - perspective()
      Each of these three functions completely replaces the projection matrix with a new one. They can be called inside setup(), and their effects will be felt inside draw(). At the top of draw(), the projection matrix is not reset. Therefore the last projection function to be called always dominates. On resize, the default projection is always established, which has perspective.

      This behavior is pretty much familiar from OpenGL, except where functions replace matrices, rather than multiplying against the previous.

      Overrides:
        `perspective` in class `PGraphicsOpenGL`

    - #### perspective

          public void perspective(float fov,
                         float aspect,
                         float zNear,
                         float zFar)

      Description copied from class: `PGraphicsOpenGL`
      Similar to gluPerspective(). Implementation based on Mesa's glu.c
      Overrides:
        `perspective` in class `PGraphicsOpenGL`
      Parameters:
        `fov` - field-of-view angle (in radians) for vertical direction
        `aspect` - ratio of width to height
        `zNear` - z-position of nearest clipping plane
        `zFar` - z-position of farthest clipping plane

    - #### frustum

          public void frustum(float left,
                     float right,
                     float bottom,
                     float top,
                     float znear,
                     float zfar)

      Description copied from class: `PGraphicsOpenGL`
      Same as glFrustum(), except that it wipes out (rather than multiplies against) the current perspective matrix.

      Implementation based on the explanation in the OpenGL blue book.

      Overrides:
        `frustum` in class `PGraphicsOpenGL`
      Parameters:
        `left` - left coordinate of the clipping plane
        `right` - right coordinate of the clipping plane
        `bottom` - bottom coordinate of the clipping plane
        `top` - top coordinate of the clipping plane
        `znear` - near component of the clipping plane; must be greater than zero
        `zfar` - far component of the clipping plane; must be greater than the near value
      See Also:
        `PGraphics.camera(float, float, float, float, float, float, float, float, float)`, `PGraphics.endCamera()`, `PGraphics.perspective(float, float, float, float)`

    - #### beginCamera

          public void beginCamera()

      Description copied from class: `PGraphicsOpenGL`
      Set matrix mode to the camera matrix (instead of the current transformation matrix). This means applyMatrix, resetMatrix, etc. will affect the camera.

      Note that the camera matrix is *not* the perspective matrix, it contains the values of the modelview matrix immediatly after the latter was initialized with ortho() or camera(), or the modelview matrix as result of the operations applied between beginCamera()/endCamera().

      beginCamera() specifies that all coordinate transforms until endCamera() should be pre-applied in inverse to the camera transform matrix. Note that this is only challenging when a user specifies an arbitrary matrix with applyMatrix(). Then that matrix will need to be inverted, which may not be possible. But take heart, if a user is applying a non-invertible matrix to the camera transform, then he is clearly up to no good, and we can wash our hands of those bad intentions.

      begin/endCamera clauses do not automatically reset the camera transform matrix. That's because we set up a nice default camera transform in setup(), and we expect it to hold through draw(). So we don't reset the camera transform matrix at the top of draw(). That means that an innocuous-looking clause like

           beginCamera();
           translate(0, 0, 10);
           endCamera();

      at the top of draw(), will result in a runaway camera that shoots infinitely out of the screen over time. In order to prevent this, it is necessary to call some function that does a hard reset of the camera transform matrix inside of begin/endCamera. Two options are

           camera(); // sets up the nice default camera transform
           resetMatrix(); // sets up the identity camera transform

      So to rotate a camera a constant amount, you might try

           beginCamera();
           camera();
           rotateY(PI / 8);
           endCamera();

      Overrides:
        `beginCamera` in class `PGraphicsOpenGL`
      See Also:
        `PGraphics.camera()`, `PGraphics.endCamera()`, `PGraphics.applyMatrix(PMatrix)`, `PGraphics.resetMatrix()`, `PGraphics.translate(float, float, float)`, `PGraphics.scale(float, float, float)`

    - #### endCamera

          public void endCamera()

      Description copied from class: `PGraphicsOpenGL`
      Record the current settings into the camera matrix, and set the matrix mode back to the current transformation matrix.

      Note that this will destroy any settings to scale(), translate(), or whatever, because the final camera matrix will be copied (not multiplied) into the modelview.

      Overrides:
        `endCamera` in class `PGraphicsOpenGL`
      See Also:
        `PGraphics.camera(float, float, float, float, float, float, float, float, float)`

    - #### camera

          public void camera()

      Description copied from class: `PGraphicsOpenGL`
      Set camera to the default settings.

      Processing camera behavior:

      Camera behavior can be split into two separate components, camera transformation, and projection. The transformation corresponds to the physical location, orientation, and scale of the camera. In a physical camera metaphor, this is what can manipulated by handling the camera body (with the exception of scale, which doesn't really have a physcial analog). The projection corresponds to what can be changed by manipulating the lens.

      We maintain separate matrices to represent the camera transform and projection. An important distinction between the two is that the camera transform should be invertible, where the projection matrix should not, since it serves to map three dimensions to two. It is possible to bake the two matrices into a single one just by multiplying them together, but it isn't a good idea, since lighting, z-ordering, and z-buffering all demand a true camera z coordinate after modelview and camera transforms have been applied but before projection. If the camera transform and projection are combined there is no way to recover a good camera-space z-coordinate from a model coordinate.

      Fortunately, there are no functions that manipulate both camera transformation and projection.

      camera() sets the camera position, orientation, and center of the scene. It replaces the camera transform with a new one.

      The transformation functions are the same ones used to manipulate the modelview matrix (scale, translate, rotate, etc.). But they are bracketed with beginCamera(), endCamera() to indicate that they should apply (in inverse), to the camera transformation matrix.

      Overrides:
        `camera` in class `PGraphicsOpenGL`
      See Also:
        `PGraphics.endCamera()`, `PGraphics.frustum(float, float, float, float, float, float)`

    - #### camera

          public void camera(float eyeX,
                    float eyeY,
                    float eyeZ,
                    float centerX,
                    float centerY,
                    float centerZ,
                    float upX,
                    float upY,
                    float upZ)

      Description copied from class: `PGraphicsOpenGL`
      More flexible method for dealing with camera().

      The actual call is like gluLookat. Here's the real skinny on what does what:

           camera(); or
           camera(ex, ey, ez, cx, cy, cz, ux, uy, uz);

      do not need to be called from with beginCamera();/endCamera(); That's because they always apply to the camera transformation, and they always totally replace it. That means that any coordinate transforms done before camera(); in draw() will be wiped out. It also means that camera() always operates in untransformed world coordinates. Therefore it is always redundant to call resetMatrix(); before camera(); This isn't technically true of gluLookat, but it's pretty much how it's used.

      Now, beginCamera(); and endCamera(); are useful if you want to move the camera around using transforms like translate(), etc. They will wipe out any coordinate system transforms that occur before them in draw(), but they will not automatically wipe out the camera transform. This means that they should be at the top of draw(). It also means that the following:

           beginCamera();
           rotateY(PI / 8);
           endCamera();

      will result in a camera that spins without stopping. If you want to just rotate a small constant amount, try this:

           beginCamera();
           camera(); // sets up the default view
           rotateY(PI / 8);
           endCamera();

      That will rotate a little off of the default view. Note that this is entirely equivalent to

           camera(); // sets up the default view
           beginCamera();
           rotateY(PI / 8);
           endCamera();

      because camera() doesn't care whether or not it's inside a begin/end clause. Basically it's safe to use camera() or camera(ex, ey, ez, cx, cy, cz, ux, uy, uz) as naked calls because they do all the matrix resetting automatically.
      Overrides:
        `camera` in class `PGraphicsOpenGL`
      Parameters:
        `eyeX` - x-coordinate for the eye
        `eyeY` - y-coordinate for the eye
        `eyeZ` - z-coordinate for the eye
        `centerX` - x-coordinate for the center of the scene
        `centerY` - y-coordinate for the center of the scene
        `centerZ` - z-coordinate for the center of the scene
        `upX` - usually 0.0, 1.0, or -1.0
        `upY` - usually 0.0, 1.0, or -1.0
        `upZ` - usually 0.0, 1.0, or -1.0

    - #### shape

          public void shape(PShape shape)

      Overrides:
        `shape` in class `PGraphics`

    - #### shape

          public void shape(PShape shape,
                   float x,
                   float y)

      Description copied from class: `PGraphics`
      ( begin auto-generated from shape.xml ) Displays shapes to the screen. The shapes must be in the sketch's "data" directory to load correctly. Select "Add file..." from the "Sketch" menu to add the shape. Processing currently works with SVG shapes only. The sh parameter specifies the shape to display and the x and y parameters define the location of the shape from its upper-left corner. The shape is displayed at its original size unless the width and height parameters specify a different size. The shapeMode() function changes the way the parameters work. A call to shapeMode(CORNERS), for example, will change the width and height parameters to define the x and y values of the opposite corner of the shape.
      Note complex shapes may draw awkwardly with P3D. This renderer does not yet support shapes that have holes or complicated breaks. ( end auto-generated )
      Overrides:
        `shape` in class `PGraphics`
      Parameters:
        `shape` - the shape to display
        `x` - x-coordinate of the shape
        `y` - y-coordinate of the shape
      See Also:
        `PShape`, `PApplet.loadShape(String)`, `Convenience method to draw at a particular location.`

    - #### shape

          public void shape(PShape shape,
                   float a,
                   float b,
                   float c,
                   float d)

      Overrides:
        `shape` in class `PGraphics`
        `a` - x-coordinate of the shape
        `b` - y-coordinate of the shape
        `c` - width to display the shape
        `d` - height to display the shape

    - #### shape

          public void shape(PShape shape,
                   float x,
                   float y,
                   float z)

    - #### shape

          public void shape(PShape shape,
                   float x,
                   float y,
                   float z,
                   float c,
                   float d,
                   float e)

    - #### createShape

          public PShape createShape(PShape source)

      Overrides:
        `createShape` in class `PGraphics`

    - #### createShape

          public PShape createShape()

      Overrides:
        `createShape` in class `PGraphics`
      See Also:
        `PShape`, `PShape.endShape()`, `PApplet.loadShape(String)`

    - #### createShape

          public PShape createShape(int type)

      Overrides:
        `createShape` in class `PGraphics`
      Parameters:
        `type` - either POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, QUAD_STRIP

    - #### createShape

          public PShape createShape(int kind,
                           float... p)

      Overrides:
        `createShape` in class `PGraphics`
      Parameters:
        `kind` - either LINE, TRIANGLE, RECT, ELLIPSE, ARC, SPHERE, BOX
        `p` - parameters that match the kind of shape

    - #### bezierVertex

          public void bezierVertex(float x2,
                          float y2,
                          float z2,
                          float x3,
                          float y3,
                          float z3,
                          float x4,
                          float y4,
                          float z4)

      Description copied from class: `PGraphics`
      ( begin auto-generated from bezierVertex.xml ) Specifies vertex coordinates for Bezier curves. Each call to bezierVertex() defines the position of two control points and one anchor point of a Bezier curve, adding a new segment to a line or shape. The first time bezierVertex() is used within a beginShape() call, it must be prefaced with a call to vertex() to set the first anchor point. This function must be used between beginShape() and endShape() and only when there is no MODE parameter specified to beginShape(). Using the 3D version requires rendering with P3D (see the Environment reference for more information). ( end auto-generated )
      Overrides:
        `bezierVertex` in class `PGraphicsOpenGL`
      Parameters:
        `x2` - the x-coordinate of the 1st control point
        `y2` - the y-coordinate of the 1st control point
        `z2` - the z-coordinate of the 1st control point
        `x3` - the x-coordinate of the 2nd control point
        `y3` - the y-coordinate of the 2nd control point
        `z3` - the z-coordinate of the 2nd control point
        `x4` - the x-coordinate of the anchor point
        `y4` - the y-coordinate of the anchor point
        `z4` - the z-coordinate of the anchor point
      See Also:
        `PGraphics.curveVertex(float, float, float)`, `PGraphics.vertex(float, float, float, float, float)`, `PGraphics.quadraticVertex(float, float, float, float, float, float)`, `PGraphics.bezier(float, float, float, float, float, float, float, float, float, float, float, float)`

    - #### quadraticVertex

          public void quadraticVertex(float x2,
                             float y2,
                             float z2,
                             float x4,
                             float y4,
                             float z4)

      Overrides:
        `quadraticVertex` in class `PGraphicsOpenGL`
        `z2` - the z-coordinate of the control point
        `z4` - the z-coordinate of the anchor point

    - #### curveVertex

          public void curveVertex(float x,
                         float y,
                         float z)

      Overrides:
        `curveVertex` in class `PGraphicsOpenGL`
        `z` - the z-coordinate of the vertex

    - #### box

          public void box(float w,
                 float h,
                 float d)

      Overrides:
        `box` in class `PGraphicsOpenGL`
      Parameters:
        `w` - dimension of the box in the x-dimension
        `h` - dimension of the box in the y-dimension
        `d` - dimension of the box in the z-dimension

    - #### sphere

          public void sphere(float r)

      Description copied from class: `PGraphics`
      ( begin auto-generated from sphere.xml ) A sphere is a hollow ball made from tessellated triangles. ( end auto-generated )

      ### Advanced

      Implementation notes:

      cache all the points of the sphere in a static array top and bottom are just a bunch of triangles that land in the center point

      sphere is a series of concentric circles who radii vary along the shape, based on, er.. cos or something

           [toxi 031031] new sphere code. removed all multiplies with
           radius, as scale() will take care of that anyway

           [toxi 031223] updated sphere code (removed modulos)
           and introduced sphereAt(x,y,z,r)
           to avoid additional translate()'s on the user/sketch side

           [davbol 080801] now using separate sphereDetailU/V

      Overrides:
        `sphere` in class `PGraphicsOpenGL`
      Parameters:
        `r` - the radius of the sphere
      See Also:
        `PGraphics.sphereDetail(int)`

    - #### vertex

          public void vertex(float x,
                    float y,
                    float z)

      Overrides:
        `vertex` in class `PGraphicsOpenGL`

    - #### vertex

          public void vertex(float x,
                    float y,
                    float z,
                    float u,
                    float v)

      Description copied from class: `PGraphics`
      ( begin auto-generated from vertex.xml ) All shapes are constructed by connecting a series of vertices. vertex() is used to specify the vertex coordinates for points, lines, triangles, quads, and polygons and is used exclusively within the beginShape() and endShape() function.
      Drawing a vertex in 3D using the z parameter requires the P3D parameter in combination with size as shown in the above example.
      This function is also used to map a texture onto the geometry. The texture() function declares the texture to apply to the geometry and the u and v coordinates set define the mapping of this texture to the form. By default, the coordinates used for u and v are specified in relation to the image's size in pixels, but this relation can be changed with textureMode(). ( end auto-generated )
      Overrides:
        `vertex` in class `PGraphicsOpenGL`
      Parameters:
        `x` - x-coordinate of the vertex
        `y` - y-coordinate of the vertex
        `z` - z-coordinate of the vertex
        `u` - horizontal coordinate for the texture mapping
        `v` - vertical coordinate for the texture mapping
      See Also:
        `PGraphics.beginShape(int)`, `PGraphics.endShape(int)`, `PGraphics.bezierVertex(float, float, float, float, float, float, float, float, float)`, `PGraphics.quadraticVertex(float, float, float, float, float, float)`, `PGraphics.curveVertex(float, float, float)`, `PGraphics.texture(PImage)`

    - #### translate

          public void translate(float tx,
                       float ty,
                       float tz)

      Overrides:
        `translate` in class `PGraphicsOpenGL`
        `tz` - forward/backward translation

    - #### rotateX

          public void rotateX(float angle)

      Description copied from class: `PGraphics`
      ( begin auto-generated from rotateX.xml ) Rotates a shape around the x-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a counterclockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotateX(PI/2) and then rotateX(PI/2) is the same as rotateX(PI). If rotateX() is called within the draw(), the transformation is reset when the loop begins again. This function requires using P3D as a third parameter to size() as shown in the example above. ( end auto-generated )
      Overrides:
        `rotateX` in class `PGraphicsOpenGL`
      Parameters:
        `angle` - angle of rotation specified in radians
      See Also:
        `PGraphics.popMatrix()`, `PGraphics.pushMatrix()`, `PGraphics.rotate(float)`, `PGraphics.rotateY(float)`, `PGraphics.rotateZ(float)`, `PGraphics.scale(float, float, float)`, `PGraphics.translate(float, float, float)`

    - #### rotateY

          public void rotateY(float angle)

      Description copied from class: `PGraphics`
      ( begin auto-generated from rotateY.xml ) Rotates a shape around the y-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a counterclockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotateY(PI/2) and then rotateY(PI/2) is the same as rotateY(PI). If rotateY() is called within the draw(), the transformation is reset when the loop begins again. This function requires using P3D as a third parameter to size() as shown in the examples above. ( end auto-generated )
      Overrides:
        `rotateY` in class `PGraphicsOpenGL`
      Parameters:
        `angle` - angle of rotation specified in radians
      See Also:
        `PGraphics.popMatrix()`, `PGraphics.pushMatrix()`, `PGraphics.rotate(float)`, `PGraphics.rotateX(float)`, `PGraphics.rotateZ(float)`, `PGraphics.scale(float, float, float)`, `PGraphics.translate(float, float, float)`

    - #### rotateZ

          public void rotateZ(float angle)

      Description copied from class: `PGraphics`
      ( begin auto-generated from rotateZ.xml ) Rotates a shape around the z-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to PI*2) or converted to radians with the radians() function. Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a counterclockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotateZ(PI/2) and then rotateZ(PI/2) is the same as rotateZ(PI). If rotateZ() is called within the draw(), the transformation is reset when the loop begins again. This function requires using P3D as a third parameter to size() as shown in the examples above. ( end auto-generated )
      Overrides:
        `rotateZ` in class `PGraphicsOpenGL`
      Parameters:
        `angle` - angle of rotation specified in radians
      See Also:
        `PGraphics.popMatrix()`, `PGraphics.pushMatrix()`, `PGraphics.rotate(float)`, `PGraphics.rotateX(float)`, `PGraphics.rotateY(float)`, `PGraphics.scale(float, float, float)`, `PGraphics.translate(float, float, float)`

    - #### rotate

          public void rotate(float angle,
                    float vx,
                    float vy,
                    float vz)

      Description copied from class: `PGraphicsOpenGL`
      Rotate around an arbitrary vector, similar to glRotate(), except that it takes radians (instead of degrees).
      Overrides:
        `rotate` in class `PGraphicsOpenGL`

    - #### applyMatrix

          public void applyMatrix(PMatrix3D source)

      Overrides:
        `applyMatrix` in class `PGraphicsOpenGL`

    - #### applyMatrix

          public void applyMatrix(float n00,
                         float n01,
                         float n02,
                         float n03,
                         float n10,
                         float n11,
                         float n12,
                         float n13,
                         float n20,
                         float n21,
                         float n22,
                         float n23,
                         float n30,
                         float n31,
                         float n32,
                         float n33)

      Description copied from class: `PGraphicsOpenGL`
      Apply a 4x4 transformation matrix to the modelview stack.
      Overrides:
        `applyMatrix` in class `PGraphicsOpenGL`
        `n03` - numbers which define the 4x4 matrix to be multiplied
        `n13` - numbers which define the 4x4 matrix to be multiplied
        `n20` - numbers which define the 4x4 matrix to be multiplied
        `n21` - numbers which define the 4x4 matrix to be multiplied
        `n22` - numbers which define the 4x4 matrix to be multiplied
        `n23` - numbers which define the 4x4 matrix to be multiplied
        `n30` - numbers which define the 4x4 matrix to be multiplied
        `n31` - numbers which define the 4x4 matrix to be multiplied
        `n32` - numbers which define the 4x4 matrix to be multiplied
        `n33` - numbers which define the 4x4 matrix to be multiplied

    - #### scale

          public void scale(float sx,
                   float sy,
                   float sz)

      Description copied from class: `PGraphicsOpenGL`
      Scale in three dimensions.
      Overrides:
        `scale` in class `PGraphicsOpenGL`
        `sz` - percentage to scale the object in the z-axis

    - #### screenX

          public float screenX(float x,
                      float y,
                      float z)

      Overrides:
        `screenX` in class `PGraphicsOpenGL`
        `z` - 3D z-coordinate to be mapped

    - #### screenY

          public float screenY(float x,
                      float y,
                      float z)

      Overrides:
        `screenY` in class `PGraphicsOpenGL`
        `z` - 3D z-coordinate to be mapped

    - #### screenZ

          public float screenZ(float x,
                      float y,
                      float z)

      Description copied from class: `PGraphics`
      ( begin auto-generated from screenZ.xml ) Takes a three-dimensional X, Y, Z position and returns the Z value for where it will appear on a (two-dimensional) screen. ( end auto-generated )
      Overrides:
        `screenZ` in class `PGraphicsOpenGL`
      Parameters:
        `x` - 3D x-coordinate to be mapped
        `y` - 3D y-coordinate to be mapped
        `z` - 3D z-coordinate to be mapped
      See Also:
        `PGraphics.screenX(float, float, float)`, `PGraphics.screenY(float, float, float)`

    - #### getMatrix

          public PMatrix3D getMatrix(PMatrix3D target)

      Description copied from class: `PGraphics`
      Copy the current transformation matrix into the specified target. Pass in null to create a new matrix.
      Overrides:
        `getMatrix` in class `PGraphicsOpenGL`

    - #### setMatrix

          public void setMatrix(PMatrix3D source)

      Description copied from class: `PGraphicsOpenGL`
      Set the current transformation to the contents of the specified source.
      Overrides:
        `setMatrix` in class `PGraphicsOpenGL`

    - #### lights

          public void lights()

      Description copied from class: `PGraphicsOpenGL`
      Sets up an ambient and directional light using OpenGL. API taken from PGraphics3D.

           The Lighting Skinny:
           The way lighting works is complicated enough that it's worth
           producing a document to describe it. Lighting calculations proceed
           pretty much exactly as described in the OpenGL red book.
           Light-affecting material properties:
             AMBIENT COLOR
             - multiplies by light's ambient component
             - for believability this should match diffuse color
             DIFFUSE COLOR
             - multiplies by light's diffuse component
             SPECULAR COLOR
             - multiplies by light's specular component
             - usually less colored than diffuse/ambient
             SHININESS
             - the concentration of specular effect
             - this should be set pretty high (20-50) to see really
               noticeable specularity
             EMISSIVE COLOR
             - constant additive color effect
           Light types:
             AMBIENT
             - one color
             - no specular color
             - no direction
             - may have falloff (constant, linear, and quadratic)
             - may have position (which matters in non-constant falloff case)
             - multiplies by a material's ambient reflection
             DIRECTIONAL
             - has diffuse color
             - has specular color
             - has direction
             - no position
             - no falloff
             - multiplies by a material's diffuse and specular reflections
             POINT
             - has diffuse color
             - has specular color
             - has position
             - no direction
             - may have falloff (constant, linear, and quadratic)
             - multiplies by a material's diffuse and specular reflections
             SPOT
             - has diffuse color
             - has specular color
             - has position
             - has direction
             - has cone angle (set to half the total cone angle)
             - has concentration value
             - may have falloff (constant, linear, and quadratic)
             - multiplies by a material's diffuse and specular reflections
           Normal modes:
           All of the primitives (rect, box, sphere, etc.) have their normals
           set nicely. During beginShape/endShape normals can be set by the user.
             AUTO-NORMAL
             - if no normal is set during the shape, we are in auto-normal mode
             - auto-normal calculates one normal per triangle (face-normal mode)
             SHAPE-NORMAL
             - if one normal is set during the shape, it will be used for
               all vertices
             VERTEX-NORMAL
             - if multiple normals are set, each normal applies to
               subsequent vertices
             - (except for the first one, which applies to previous
               and subsequent vertices)
           Efficiency consequences:
             There is a major efficiency consequence of position-dependent
             lighting calculations per vertex. (See below for determining
             whether lighting is vertex position-dependent.) If there is no
             position dependency then the only factors that affect the lighting
             contribution per vertex are its colors and its normal.
             There is a major efficiency win if
             1) lighting is not position dependent
             2) we are in AUTO-NORMAL or SHAPE-NORMAL mode
             because then we can calculate one lighting contribution per shape
             (SHAPE-NORMAL) or per triangle (AUTO-NORMAL) and simply multiply it
             into the vertex colors. The converse is our worst-case performance when
             1) lighting is position dependent
             2) we are in AUTO-NORMAL mode
             because then we must calculate lighting per-face * per-vertex.
             Each vertex has a different lighting contribution per face in
             which it appears. Yuck.
           Determining vertex position dependency:
             If any of the following factors are TRUE then lighting is
             vertex position dependent:
             1) Any lights uses non-constant falloff
             2) There are any point or spot lights
             3) There is a light with specular color AND there is a
                material with specular color
           So worth noting is that default lighting (a no-falloff ambient
           and a directional without specularity) is not position-dependent.
           We should capitalize.
           Simon Greenwold, April 2005

      Overrides:
        `lights` in class `PGraphicsOpenGL`
      See Also:
        `PGraphics.ambientLight(float, float, float, float, float, float)`, `PGraphics.directionalLight(float, float, float, float, float, float)`, `PGraphics.pointLight(float, float, float, float, float, float)`, `PGraphics.spotLight(float, float, float, float, float, float, float, float, float, float, float)`, `PGraphics.noLights()`

    - #### noLights

          public void noLights()

      Description copied from class: `PGraphicsOpenGL`
      Disables lighting.
      Overrides:
        `noLights` in class `PGraphicsOpenGL`
      See Also:
        `PGraphics.lights()`

    - #### ambientLight

          public void ambientLight(float red,
                          float green,
                          float blue)

      Description copied from class: `PGraphicsOpenGL`
      Add an ambient light based on the current color mode.
      Overrides:
        `ambientLight` in class `PGraphicsOpenGL`
      Parameters:
        `red` - red or hue value (depending on current color mode)
        `green` - green or saturation value (depending on current color mode)
        `blue` - blue or brightness value (depending on current color mode)
      See Also:
        `PGraphics.lights()`, `PGraphics.directionalLight(float, float, float, float, float, float)`, `PGraphics.pointLight(float, float, float, float, float, float)`, `PGraphics.spotLight(float, float, float, float, float, float, float, float, float, float, float)`

    - #### ambientLight

          public void ambientLight(float red,
                          float green,
                          float blue,
                          float x,
                          float y,
                          float z)

      Description copied from class: `PGraphicsOpenGL`
      Add an ambient light based on the current color mode. This version includes an (x, y, z) position for situations where the falloff distance is used.
      Overrides:
        `ambientLight` in class `PGraphicsOpenGL`
        `x` - x-coordinate of the light
        `y` - y-coordinate of the light
        `z` - z-coordinate of the light

    - #### directionalLight

          public void directionalLight(float red,
                              float green,
                              float blue,
                              float nx,
                              float ny,
                              float nz)

      Description copied from class: `PGraphics`
      ( begin auto-generated from directionalLight.xml ) Adds a directional light. Directional light comes from one direction and is stronger when hitting a surface squarely and weaker if it hits at a a gentle angle. After hitting a surface, a directional lights scatters in all directions. Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop. The affect of the v1, v2, and v3 parameters is determined by the current color mode. The nx, ny, and nz parameters specify the direction the light is facing. For example, setting ny to -1 will cause the geometry to be lit from below (the light is facing directly upward). ( end auto-generated )
      Overrides:
        `directionalLight` in class `PGraphicsOpenGL`
      Parameters:
        `red` - red or hue value (depending on current color mode)
        `green` - green or saturation value (depending on current color mode)
        `blue` - blue or brightness value (depending on current color mode)
        `nx` - direction along the x-axis
        `ny` - direction along the y-axis
        `nz` - direction along the z-axis
      See Also:
        `PGraphics.lights()`, `PGraphics.ambientLight(float, float, float, float, float, float)`, `PGraphics.pointLight(float, float, float, float, float, float)`, `PGraphics.spotLight(float, float, float, float, float, float, float, float, float, float, float)`

    - #### pointLight

          public void pointLight(float red,
                        float green,
                        float blue,
                        float x,
                        float y,
                        float z)

      Description copied from class: `PGraphics`
      ( begin auto-generated from pointLight.xml ) Adds a point light. Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop. The affect of the v1, v2, and v3 parameters is determined by the current color mode. The x, y, and z parameters set the position of the light. ( end auto-generated )
      Overrides:
        `pointLight` in class `PGraphicsOpenGL`
      Parameters:
        `red` - red or hue value (depending on current color mode)
        `green` - green or saturation value (depending on current color mode)
        `blue` - blue or brightness value (depending on current color mode)
        `x` - x-coordinate of the light
        `y` - y-coordinate of the light
        `z` - z-coordinate of the light
      See Also:
        `PGraphics.lights()`, `PGraphics.directionalLight(float, float, float, float, float, float)`, `PGraphics.ambientLight(float, float, float, float, float, float)`, `PGraphics.spotLight(float, float, float, float, float, float, float, float, float, float, float)`

    - #### spotLight

          public void spotLight(float red,
                       float green,
                       float blue,
                       float x,
                       float y,
                       float z,
                       float nx,
                       float ny,
                       float nz,
                       float angle,
                       float concentration)

      Description copied from class: `PGraphics`
      ( begin auto-generated from spotLight.xml ) Adds a spot light. Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop. The affect of the v1, v2, and v3 parameters is determined by the current color mode. The x, y, and z parameters specify the position of the light and nx, ny, nz specify the direction or light. The angle parameter affects angle of the spotlight cone. ( end auto-generated )
      Overrides:
        `spotLight` in class `PGraphicsOpenGL`
      Parameters:
        `red` - red or hue value (depending on current color mode)
        `green` - green or saturation value (depending on current color mode)
        `blue` - blue or brightness value (depending on current color mode)
        `x` - x-coordinate of the light
        `y` - y-coordinate of the light
        `z` - z-coordinate of the light
        `nx` - direction along the x axis
        `ny` - direction along the y axis
        `nz` - direction along the z axis
        `angle` - angle of the spotlight cone
        `concentration` - exponent determining the center bias of the cone
      See Also:
        `PGraphics.lights()`, `PGraphics.directionalLight(float, float, float, float, float, float)`, `PGraphics.pointLight(float, float, float, float, float, float)`, `PGraphics.ambientLight(float, float, float, float, float, float)`

    - #### lightFalloff

          public void lightFalloff(float constant,
                          float linear,
                          float quadratic)

      Description copied from class: `PGraphicsOpenGL`
      Set the light falloff rates for the last light that was created. Default is lightFalloff(1, 0, 0).
      Overrides:
        `lightFalloff` in class `PGraphicsOpenGL`
      Parameters:
        `constant` - constant value or determining falloff
        `linear` - linear value for determining falloff
        `quadratic` - quadratic value for determining falloff
      See Also:
        `PGraphics.lights()`, `PGraphics.ambientLight(float, float, float, float, float, float)`, `PGraphics.pointLight(float, float, float, float, float, float)`, `PGraphics.spotLight(float, float, float, float, float, float, float, float, float, float, float)`, `PGraphics.lightSpecular(float, float, float)`

    - #### lightSpecular

          public void lightSpecular(float v1,
                           float v2,
                           float v3)

      Description copied from class: `PGraphicsOpenGL`
      Set the specular color of the last light created.
      Overrides:
        `lightSpecular` in class `PGraphicsOpenGL`
      Parameters:
        `v1` - red or hue value (depending on current color mode)
        `v2` - green or saturation value (depending on current color mode)
        `v3` - blue or brightness value (depending on current color mode)
      See Also:
        `PGraphics.specular(float, float, float)`, `PGraphics.lights()`, `PGraphics.ambientLight(float, float, float, float, float, float)`, `PGraphics.pointLight(float, float, float, float, float, float)`, `PGraphics.spotLight(float, float, float, float, float, float, float, float, float, float, float)`