GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Processing
  • Download
  • Reference
  • Environment
  • Libraries
  • Tools
  • Wiki
  • Tutorials
  • Examples
  • Books
  • Forum
  • Overview
  • People
  • Privacy

This view

  • Original page
  • New address

GeezerVison is showing processing.org — beginContour() / Reference

Reference+
Documentation→Reference→Shape→Vertex

Name

beginContour()

Description

Use the beginContour() and endContour() function to create negative shapes within shapes such as the center of the letter "O". beginContour() begins recording vertices for the shape and endContour() stops recording. The vertices that define a negative shape must "wind" in the opposite direction from the exterior shape. First draw vertices for the exterior shape in clockwise order, then for internal shapes, draw vertices counterclockwise.

These functions can only be used within a beginShape()/endShape() pair and transformations such as translate(), rotate(), and scale() do not work within a beginContour()/endContour() pair. It is also not possible to use other shapes, such as ellipse() or rect() within.

Examples

  • size(400,400);
    translate(200, 200);
    stroke(255, 0, 0);
    beginShape();
    // Exterior part of shape, clockwise winding
    vertex(-160, -160);
    vertex(160, -160);
    vertex(160, 160);
    vertex(-160, 160);
    // Interior part of shape, counter-clockwise winding
    beginContour();
    vertex(-80, -80);
    vertex(-80, 80);
    vertex(80, 80);
    vertex(80, -80);
    endContour();
    endShape(CLOSE);
    

Syntax

  • beginContour()

Return

  • void
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.