mirror of
https://github.com/processing/processing4.git
synced 2026-01-31 12:21:07 +01:00
43 lines
978 B
Java
43 lines
978 B
Java
import processing.core.*;
|
|
|
|
import java.applet.*;
|
|
import java.awt.*;
|
|
import java.awt.image.*;
|
|
import java.awt.event.*;
|
|
import java.io.*;
|
|
import java.net.*;
|
|
import java.text.*;
|
|
import java.util.*;
|
|
import java.util.zip.*;
|
|
import java.util.regex.*;
|
|
|
|
public class ShapePrimitives extends PApplet {
|
|
public void setup() {/**
|
|
* Shape Primitives.
|
|
*
|
|
* The basic shape primitive functions are triangle(),
|
|
* rect(), quad(), and ellipse(). Squares are made
|
|
* with rect() and circles are made with
|
|
* ellipse(). Each of these functions requires a number
|
|
* of parameters which determines their position and size.
|
|
*/
|
|
|
|
size(200, 200);
|
|
smooth();
|
|
background(0);
|
|
noStroke();
|
|
fill(226);
|
|
triangle(10, 10, 10, 200, 45, 200);
|
|
rect(45, 45, 35, 35);
|
|
quad(105, 10, 120, 10, 120, 200, 80, 200);
|
|
ellipse(140, 80, 40, 40);
|
|
triangle(160, 10, 195, 200, 160, 200);
|
|
|
|
|
|
noLoop();
|
|
}
|
|
static public void main(String args[]) {
|
|
PApplet.main(new String[] { "ShapePrimitives" });
|
|
}
|
|
}
|