Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cos function uses radian, not degree. #2

Open
jjaychen1e opened this issue Dec 18, 2020 · 0 comments
Open

cos function uses radian, not degree. #2

jjaychen1e opened this issue Dec 18, 2020 · 0 comments

Comments

@jjaychen1e
Copy link

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant