Games101 icon indicating copy to clipboard operation
Games101 copied to clipboard

cos function uses radian, not degree.

Open jjaychen1e opened this issue 4 years ago • 0 comments

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;

jjaychen1e avatar Dec 18 '20 07:12 jjaychen1e