mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 07:22:01 +00:00
erase magic number
This commit is contained in:
parent
85d8025cd6
commit
0006e3f0f4
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ void RayTracer::render(Scene *scene) {
|
||||||
Vector3f cameraPos = scene->getCenter();
|
Vector3f cameraPos = scene->getCenter();
|
||||||
Vector3f lookAt = scene->getLookAt();
|
Vector3f lookAt = scene->getLookAt();
|
||||||
Vector3f up = scene->getUpVector();
|
Vector3f up = scene->getUpVector();
|
||||||
float vpHeight = 2 * tan(fov / 180 * 3.14159265 / 2) * lookAt.norm();
|
float vpHeight = 2 * tan(fov / 180 * M_PI / 2) * lookAt.norm();
|
||||||
float vpWidth = vpHeight * width / height;
|
float vpWidth = vpHeight * width / height;
|
||||||
Vector3f vpU = Vector3f(-vpWidth, 0, 0);
|
Vector3f vpU = Vector3f(-vpWidth, 0, 0);
|
||||||
Vector3f vpV = Vector3f(0, vpHeight, 0);
|
Vector3f vpV = Vector3f(0, vpHeight, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue