We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, scale factor of the projection (used to compute radius to screen), is computed as float(height) / (tanf(projection.fov * 0.5f) * 2.0f);.
float(height) / (tanf(projection.fov * 0.5f) * 2.0f);
projection.fov is 45, so these are presumably degrees . However, tanf expects radians, both in C and in C++.
projection.fov
45
tanf
C
C++
Shouldn't it be float(height) / (tanf(projection.fov * M_PI * 0.5f / 180.f) * 2.0f);? If not, what is the meaning of the current value?
float(height) / (tanf(projection.fov * M_PI * 0.5f / 180.f) * 2.0f);
The text was updated successfully, but these errors were encountered:
Don't pass degrees into tanf, fixes nvpro-samples#2
8c111cb
You're correct, I noticed this too.
Sorry, something went wrong.
3e01bd8
Signed-off-by: Thomas Whelan <[email protected]>
Successfully merging a pull request may close this issue.
Currently, scale factor of the projection (used to compute radius to screen), is computed as
float(height) / (tanf(projection.fov * 0.5f) * 2.0f);
.projection.fov
is45
, so these are presumably degrees . However,tanf
expects radians, both inC
and inC++
.Shouldn't it be
float(height) / (tanf(projection.fov * M_PI * 0.5f / 180.f) * 2.0f);
?If not, what is the meaning of the current value?
The text was updated successfully, but these errors were encountered: