Skip to content

Geometry.is_polygon_clockwise seems to return the opposite of expected results #49716

@davidscholberg

Description

@davidscholberg

Godot version

v3.3.2.stable.official

System information

Windows 10, GLES3, GeForce GTX 1070/PCIe/SSE2

Issue description

The results of Geometry.is_polygon_clockwise seem consistent with a cartesian coordinate system where the Y axis grows upwards. However, I was under the impression that 2D graphics in Godot used a coordinate system where the Y axis grows downward, and since Geometry.is_polygon_clockwise is an inherently 2D function, the results given seem to be the opposite of what I would have expected.

Steps to reproduce

  1. Add the following line to any node script and observe that the output is True, which is not consistent with the 2D coordinate system that Godot uses with the Y axis growing downward.
print(str(Geometry.is_polygon_clockwise(PoolVector2Array([Vector2(-1, -1), Vector2(-1, 1), Vector2(1, 1), Vector2(1, -1)]))))

Minimal reproduction project

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions