new scene

This commit is contained in:
Ben
2019-12-06 20:56:45 +00:00
parent b3c74832b3
commit 5fc0d2fd33
8 changed files with 900130 additions and 15 deletions

View File

@@ -32,9 +32,9 @@ void Camera::LookAt(glm::vec3 position, glm::vec3 sky, glm::vec3 lookAt, float a
Ray Camera::CastRay(int x, int y, float spX, float spY) {
// TODO: ACTUALLY GET A WORKING CAMERA
float camX = (((float)x + spX) / (float)width * 2.0f - 1.0f) * getAspectRatio(width, height) * getFovAdjustment(45.0f);
float camX = (((float)x + spX) / (float)width * 2.0f - 1.0f) * getAspectRatio(width, height) * getFovAdjustment(80.0f);
// 1.0 is taken first here as y is in the vertical
float camY = (1.0f - ((float)y + spY) / (float)height * 2.0f) * getFovAdjustment(45.0f);
float camY = (1.0f - ((float)y + spY) / (float)height * 2.0f) * getFovAdjustment(80.0f);
Ray ray{ {0.0f, 0.0f, 0.0f}, {camX, camY, -1.0f} };
ray.direction = glm::normalize(ray.direction);