triangle()

Shape / 2D Primitives

Description

Draws a triangle to the screen using the coordinates of its three vertices.

Syntax

void triangle(float x1, float y1, float x2, float y2, float x3, float y3)

Parameters

NameTypeDescription
x1floatx-coordinate of the first vertex
y1floaty-coordinate of the first vertex
x2floatx-coordinate of the second vertex
y2floaty-coordinate of the second vertex
x3floatx-coordinate of the third vertex
y3floaty-coordinate of the third vertex

Returns

void

Related

Under the Hood

Implementation in Processing.h / Processing.cpp:

Loading...