Skip to content

cos function uses radian, not degree. #2

@jjaychen1e

Description

@jjaychen1e

https://github.com/kingiluob/Games101/blob/master/pa0/main.cpp

Snippet:

transform << cos(45),-cos(45),1,-cos(45),cos(45),2,0,0,1;

cos function uses radian, not degree. And the rotation matrix is wrong. It should be something like this:

float angle = 45.0f / 180.0f * M_PI;
    
Eigen::Matrix3f transform;
transform << cos(angle), -sin(angle), 1,
             sin(angle),  cos(angle), 2,
                      0,           0, 1;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions