Class: PolygonPrimitive

PolygonPrimitive()

Primitive to draw a polygon shape.

Constructor

new PolygonPrimitive()

Source:

Classes

PolygonPrimitive
PolygonPrimitive

Methods

quad(ax, ay, bx, by, cx, cy, dx, dy) → {PolygonPrimitive}

Create a quad polygon.
Parameters:
Name Type Description
ax number a point x coord
ay number a point y coord
bx number b point x coord
by number b point y coord
cx number c point x coord
cy number c point y coord
dx number d point x coord
dy number d point y coord
Source:
Returns:
Type
PolygonPrimitive

quad(ax, ay, bx, by, cx, cy, dx, dy) → {PolygonPrimitive}

Create a quad polygon.
Parameters:
Name Type Description
ax number a point x coord
ay number a point y coord
bx number b point x coord
by number b point y coord
cx number c point x coord
cy number c point y coord
dx number d point x coord
dy number d point y coord
Source:
Returns:
Type
PolygonPrimitive

tri(ax, ay, bx, dy, cx, cy) → {PolygonPrimitive}

Create a triangle polygon.
Parameters:
Name Type Description
ax number a point x coord
ay number a point y coord
bx number b point x coord
dy number b point y coord
cx number c point x coord
cy number c point y coord
Source:
Returns:
Type
PolygonPrimitive

tri(ax, ay, bx, dy, cx, cy) → {PolygonPrimitive}

Create a triangle polygon.
Parameters:
Name Type Description
ax number a point x coord
ay number a point y coord
bx number b point x coord
dy number b point y coord
cx number c point x coord
cy number c point y coord
Source:
Returns:
Type
PolygonPrimitive

vertex(x, y) → {PolygonPrimitive}

Push a vertex into the vertices list.
Parameters:
Name Type Description
x number the x coordinate of the vertex
y number the y coordiante of the vertex
Source:
Returns:
Type
PolygonPrimitive

vertex(x, y) → {PolygonPrimitive}

Push a vertex into the vertices list.
Parameters:
Name Type Description
x number the x coordinate of the vertex
y number the y coordiante of the vertex
Source:
Returns:
Type
PolygonPrimitive

vertexList(list) → {PolygonPrimitive}

Push a list of vertices into the verticles list.
Parameters:
Name Type Description
list Array the list of vertices
Source:
Returns:
Type
PolygonPrimitive

vertexList(list) → {PolygonPrimitive}

Push a list of vertices into the verticles list.
Parameters:
Name Type Description
list Array the list of vertices
Source:
Returns:
Type
PolygonPrimitive

PolygonPrimitivePolygonPrimitive()

Primitive to draw a polygon shape.

Constructor

new PolygonPrimitive()

Source:

Classes

PolygonPrimitive
PolygonPrimitive

Methods

quad(ax, ay, bx, by, cx, cy, dx, dy) → {PolygonPrimitive}

Create a quad polygon.
Parameters:
Name Type Description
ax number a point x coord
ay number a point y coord
bx number b point x coord
by number b point y coord
cx number c point x coord
cy number c point y coord
dx number d point x coord
dy number d point y coord
Source:
Returns:
Type
PolygonPrimitive

quad(ax, ay, bx, by, cx, cy, dx, dy) → {PolygonPrimitive}

Create a quad polygon.
Parameters:
Name Type Description
ax number a point x coord
ay number a point y coord
bx number b point x coord
by number b point y coord
cx number c point x coord
cy number c point y coord
dx number d point x coord
dy number d point y coord
Source:
Returns:
Type
PolygonPrimitive

tri(ax, ay, bx, dy, cx, cy) → {PolygonPrimitive}

Create a triangle polygon.
Parameters:
Name Type Description
ax number a point x coord
ay number a point y coord
bx number b point x coord
dy number b point y coord
cx number c point x coord
cy number c point y coord
Source:
Returns:
Type
PolygonPrimitive

tri(ax, ay, bx, dy, cx, cy) → {PolygonPrimitive}

Create a triangle polygon.
Parameters:
Name Type Description
ax number a point x coord
ay number a point y coord
bx number b point x coord
dy number b point y coord
cx number c point x coord
cy number c point y coord
Source:
Returns:
Type
PolygonPrimitive

vertex(x, y) → {PolygonPrimitive}

Push a vertex into the vertices list.
Parameters:
Name Type Description
x number the x coordinate of the vertex
y number the y coordiante of the vertex
Source:
Returns:
Type
PolygonPrimitive

vertex(x, y) → {PolygonPrimitive}

Push a vertex into the vertices list.
Parameters:
Name Type Description
x number the x coordinate of the vertex
y number the y coordiante of the vertex
Source:
Returns:
Type
PolygonPrimitive

vertexList(list) → {PolygonPrimitive}

Push a list of vertices into the verticles list.
Parameters:
Name Type Description
list Array the list of vertices
Source:
Returns:
Type
PolygonPrimitive

vertexList(list) → {PolygonPrimitive}

Push a list of vertices into the verticles list.
Parameters:
Name Type Description
list Array the list of vertices
Source:
Returns:
Type
PolygonPrimitive