Sie sind auf Seite 1von 1

W.

01
GRAPHICS PRIMITIVES AND DRAWING

rect(x, y, width, height);


(x, y) ll(), noFill(), stroke(), noStroke()
Draws a rectangle anchored at the
top left corner, in position (x, y) Border, stroke & ll seing functions for graphics shapes
and with size width and height.
rectMode(CORNER); ll(red, green, blue) ll(red,green, blue, alpha)
rectMode(CENTER); (x,y) at the centre ll(grey_level) ll( grey_level, alpha)
rectMode(RADIUS); width and height
are the radius from the centre at (x,y)
stroke(red, green, blue) stroke(red,green, blue, alpha)
line(x1, y1, x2, y2); stroke( grey_level) stroke( grey_level, alpha)
(x1, y1)
Draws a line from point (x1, y1) to
(x2, y2) * Value scale of red, green, blue, alpha and grey_level ranges from
0 (darkest) to 255 (brightest).

noStroke() and noFill();


Disable stroke and ll color.
(x2, y2 )

quad(x1, y1, x2, y2, x3, y3, x4, y4);


(x1, y1) Draws a quadrilateral with the four
vertex positions passed to the
function.
(x4, y4) (x2, y2)
Processing Code
(x3, y3)
stroke(0); ll(255); ll(255); noFill();
noStroke(); stroke(255,0,0); stroke(255,0,0);
(x1, y1) triangle(x1, y1, x2, y2, x3, y3);
Draws a triangle with the three strokeWeight(10);
vertex positions passed as
arguments.
ll(215,223,35); strokeWeight(1); strokeWeight();
(x3, y3) (x2, y2)
Basic geometry Sets the width of the stroke used for
and graphics primitive shapes ellipse(x,y, 200, 200); strokeWeight(10);
lines, points, and the border around
shapes. All widths are set in units of
pixels.
arc(x, y, w, h, sa, ea); ellipse(x, y, width, height);
(x, y) Draws an arc from position (x,y), Draws an ellipse centered at position
sa with size w width, h height, sa (x, y) and with size width and
start angle and ea end angle height height. Specifying the same values
ea h
passed as radians. (x, y) for width and height makes a
circle.
w Useful constants in processing:
TWO_PI, PI, HALF_PI.
width

Das könnte Ihnen auch gefallen