earcut icon indicating copy to clipboard operation
earcut copied to clipboard

Update readme to clarify if vertices are output in clockwise or counterclockwise order.

Open ILOVEPIE opened this issue 2 years ago • 4 comments

I'm trying to use this in a project and haven't been able to determine which order the vertices are being output. It seems to be clockwise but I'm getting some weird behavior.

ILOVEPIE avatar May 12 '22 22:05 ILOVEPIE

Clockwise or counter-clockwise depends on your coordinate space.

Giwayume avatar Dec 19 '22 01:12 Giwayume

Can you be more specific.

ILOVEPIE avatar Dec 26 '22 22:12 ILOVEPIE

In a coordinate system where -y is pointed up, a clockwise check for a set of points forming a polygon will be the opposite from a coordinate system where +y is pointed up.

Giwayume avatar Dec 26 '22 23:12 Giwayume

I’m talking about with the default open GL coordinate system. On Mon, Dec 26, 2022 at 3:41 PM Giwayume @.***> wrote:

In a coordinate system where -y is pointed up, a clockwise check for a set of points forming a polygon will be the opposite from a coordinate system where +y is pointed up.

— Reply to this email directly, view it on GitHub https://github.com/mapbox/earcut/issues/156#issuecomment-1365509508, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACB45S5IUEMTW7QSUZGHDLWPIUKPANCNFSM5VZU73LQ . You are receiving this because you authored the thread.Message ID: @.***>

ILOVEPIE avatar Dec 27 '22 04:12 ILOVEPIE