diff options
author | David Doan <daviddoan@Davids-MacBook-Pro-193.local> | 2023-12-13 01:30:56 -0500 |
---|---|---|
committer | David Doan <daviddoan@Davids-MacBook-Pro-193.local> | 2023-12-13 01:30:56 -0500 |
commit | e5e01a62cd12a338b66c0a33775e91854a305ec4 (patch) | |
tree | 9b8a5f01d13febcc719b531e6eb26d18d0ff1067 /src/camera/camera.cpp | |
parent | ab87941ad346b0e09b7855ad834379f425538455 (diff) |
grinds
Diffstat (limited to 'src/camera/camera.cpp')
-rw-r--r-- | src/camera/camera.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/camera/camera.cpp b/src/camera/camera.cpp index 1b4cd43..9e8aef2 100644 --- a/src/camera/camera.cpp +++ b/src/camera/camera.cpp @@ -14,9 +14,14 @@ Camera::Camera(SceneCameraData cameraData) : m_inverseViewMatrix = glm::inverse(m_viewMatrix); m_inverseTranslationVector = -m_translationVector; + m_controlPoints = { + {cameraData.pos[0], cameraData.pos[1], cameraData.pos[2]}, + {cameraData.pos[0], cameraData.pos[1] - 2.f, cameraData.pos[2] - 2.f}, + {cameraData.pos[0] + 2.f, cameraData.pos[1] + 2.f, cameraData.pos[2] -2.f}, + {cameraData.pos[0] + 2.f, cameraData.pos[1], cameraData.pos[2]} + }; } - glm::mat4 Camera::getViewMatrix() const { // Optional TODO: implement the getter or make your own design return m_viewMatrix; @@ -53,4 +58,27 @@ float Camera::getFocalLength() const { float Camera::getAperture() const { // Optional TODO: implement the getter or make your own design return m_aperture; -}
\ No newline at end of file +} + +// int getPt(glm::vec3 n1 , glm::vec3 n2 , float perc ) +// { +// int diff = n2 - n1; + +// return n1 + ( diff * perc ); +// } + +// for( float i = 0 ; i < 1 ; i += 0.01 ) +// { +// glm::vec3 xa = getPt(P1, P2, i); +// glm::vec3 xb = getPt(P2, P3, i); +// glm::vec3 xc = getPt(P3, P4, i); + +// // Calculate points on the lines between the above points +// glm::vec3 xm = getPt(xa, xb, i); +// glm::vec3 xn = getPt(xb, xc, i); + +// // Calculate the final point on the Bezier curve +// glm::vec3 pointOnCurve = getPt(xm, xn, i); + + +// }
\ No newline at end of file |