love.math.triangulate
Available since LÖVE 0.9.0 |
This function is not supported in earlier versions. |
Triangulate a simple polygon.
Contents
Function
Synopsis
triangles = love.math.triangulate( polygon )
Arguments
table polygon
- Polygon to triangulate. Must not intersect itself.
Returns
table triangles
- List of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}.
Function
Synopsis
triangles = love.math.triangulate( x1, y1, x2, y2, x3, y3, ... )
Arguments
number x1
- The position of the first vertex of the polygon on the x-axis.
number y1
- The position of the first vertex of the polygon on the y-axis.
number x2
- The position of the second vertex of the polygon on the x-axis.
number y2
- The position of the second vertex of the polygon on the y-axis.
number x3
- The position of the third vertex of the polygon on the x-axis.
number y3
- The position of the third vertex of the polygon on the y-axis.
Returns
table triangles
- List of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info