aboutsummaryrefslogtreecommitdiff
path: root/src/camera
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera')
-rw-r--r--src/camera/camera.cpp32
-rw-r--r--src/camera/camera.h1
2 files changed, 31 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
diff --git a/src/camera/camera.h b/src/camera/camera.h
index 00a6733..a6e8c0a 100644
--- a/src/camera/camera.h
+++ b/src/camera/camera.h
@@ -38,6 +38,7 @@ public:
glm::vec3 getPos() const;
float cameraDepth = -1.f;
+ std::vector<glm::vec3> m_controlPoints;
private:
glm::mat4 m_viewMatrix;