I have some code that draws a graph, it gives an error when I call love.math.triangulate. I have boiled the code down to this contrived example for demonstration purposes:
Code: Select all
function love.load()
vertices = {
0, 138,
20, 138,
41, 144,
62, 162,
82, 181,
103, 181,
124, 191,
--144, 192, -- THINGS START GOING WRONG HERE :(
--165, 195,
--186, 196
}
triangles = love.math.triangulate ( vertices )
end
function love.draw()
love.graphics.setLineJoin("none")
for triNo, triangle in ipairs ( triangles ) do
love.graphics.polygon ( "fill", triangle )
end
end
function love.keypressed()
love.event.quit()
end