Difference between revisions of "MeshDrawMode"

(Created page)
 
(Added image showing the different modes)
Line 2: Line 2:
  
 
How a [[Geometry]]'s vertices are used when drawing.
 
How a [[Geometry]]'s vertices are used when drawing.
 +
 
== Constants ==
 
== Constants ==
 
;fan: The Geometry's vertices are interpreted as a "fan" shape with the first vertex acting as the hub point. Can be easily used to draw simple convex polygons.
 
;fan: The Geometry's vertices are interpreted as a "fan" shape with the first vertex acting as the hub point. Can be easily used to draw simple convex polygons.
Line 10: Line 11:
  
 
The vertex map can also be used to make the draw mode reuse vertices, for example if the Geometry has 4 vertices and is using the "triangles" draw mode, the vertex map could be set to {1, 2, 3,  1, 3, 4} to draw the Geometry as a quad.
 
The vertex map can also be used to make the draw mode reuse vertices, for example if the Geometry has 4 vertices and is using the "triangles" draw mode, the vertex map could be set to {1, 2, 3,  1, 3, 4} to draw the Geometry as a quad.
 +
 +
[[File:geometry_modes.png]]
  
 
== See Also ==
 
== See Also ==

Revision as of 19:29, 16 August 2013

Available since LÖVE 0.9.0
This enum is not supported in earlier versions.


How a Geometry's vertices are used when drawing.

Constants

fan
The Geometry's vertices are interpreted as a "fan" shape with the first vertex acting as the hub point. Can be easily used to draw simple convex polygons.
strip
The Geometry's vertices are interpreted as a series of connected triangles using vertices v1, v2, v3, then v3, v2, v4 (note the order), then v3, v4, v5 and so on.
triangles
The Geometry's vertices are interpreted as a list of unconnected triangles.

Notes

If the Geometry has a custom vertex map, then it will determine the order in which the vertices are interpreted by the draw mode.

The vertex map can also be used to make the draw mode reuse vertices, for example if the Geometry has 4 vertices and is using the "triangles" draw mode, the vertex map could be set to {1, 2, 3, 1, 3, 4} to draw the Geometry as a quad.

geometry modes.png

See Also

Other Languages