Games101
Games101 copied to clipboard
cos function uses radian, not degree.
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;