Skip to content

Inconsitent rotation directions #1088

Closed
@einarf

Description

@einarf

draw_rectangle_filled rotates clockwise while draw_rectangle_outline rotates counter-clockwise with the same angle values. This might be related to how rotate_points works.

This needs more investigation since a lot of things use rotate_point in arcde.

EDIT: This is because the outline version calls rotate_points while shapes are rotated in shader

EDIT: The conclusion is that rotations have historically been counter clockwise in arcade. In 2.4 some shapes started to rotate in the other direction due to shader rewrite and optimizations.

We have two variants of rotation matrices in shaders:

    mat2 rot = mat2(
        cos(angle), -sin(angle),
        sin(angle),  cos(angle)
    );
    mat2 rot = mat2(
        cos(angle), sin(angle),
        -sin(angle), cos(angle)
    );

.. and rotate_point is counter clockwise by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions