mapbox / earcut

The fastest and smallest JavaScript polygon triangulation library for your WebGL apps
ISC License
2.21k stars 207 forks source link

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

Open ILOVEPIE opened 2 years ago

ILOVEPIE commented 2 years ago

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.

Giwayume commented 1 year ago

Clockwise or counter-clockwise depends on your coordinate space.

ILOVEPIE commented 1 year ago

Can you be more specific.

Giwayume commented 1 year ago

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.

ILOVEPIE commented 1 year ago

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: @.***>