summaryrefslogtreecommitdiff
path: root/src/arap.cpp
diff options
context:
space:
mode:
authorSebastian Park <51029066+Seb-Park@users.noreply.github.com>2024-04-22 00:59:29 -0400
committerGitHub <noreply@github.com>2024-04-22 00:59:29 -0400
commitcd7c76017a12bb548036571c1ff13e551369d06d (patch)
tree03cd022c7625c5c5682d21c20b0a8b8532e57140 /src/arap.cpp
parent5233a708a165ba8a3153e054ce74eb11084c0158 (diff)
parent28d74097815a8d52b8f47f6eae6464005a6bc552 (diff)
Merge pull request #2 from Seb-Park/shaders
Shaders
Diffstat (limited to 'src/arap.cpp')
-rw-r--r--src/arap.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/arap.cpp b/src/arap.cpp
index 79fe475..94f2e3d 100644
--- a/src/arap.cpp
+++ b/src/arap.cpp
@@ -9,6 +9,7 @@
#include <Eigen/Core>
#include <Eigen/Sparse>
#include <Eigen/SVD>
+#include <QImage>
#include "ocean/ocean.h"
@@ -47,6 +48,45 @@ void ARAP::init
}
coeffMin = all_vertices.colwise().minCoeff();
coeffMax = all_vertices.colwise().maxCoeff();
+
+ minCorner = coeffMin;
+ maxCorner = coeffMax;
+
+
+// m_shape.initGroundPlane("cornell_box_full_lighting.png")
+// QImage ocean_floor_image;
+// GLuint ocean_floor_texture;
+// // Prepare filepath
+// QString ocean_floor_filepath = QString(":/resources/images/kitten.png");
+
+// // TASK 1: Obtain image from filepath
+// ocean_floor_image = QImage(ocean_floor_filepath);
+
+// // TASK 2: Format image to fit OpenGL
+// ocean_floor_image = ocean_floor_image.convertToFormat(QImage::Format_RGBA8888).mirrored();
+
+// // TASK 3: Generate kitten texture
+// glGenTextures(1, &ocean_floor_texture);
+
+// // TASK 9: Set the active texture slot to texture slot 0
+// glActiveTexture(GL_TEXTURE0);
+
+// // TASK 4: Bind kitten texture
+// glBindTexture(GL_TEXTURE_2D, ocean_floor_texture);
+
+// // TASK 5: Load image into kitten texture
+// glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ocean_floor_image.width(), ocean_floor_image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, ocean_floor_image.bits());
+
+// // TASK 6: Set min and mag filters' interpolation mode to linear
+// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+// // TASK 7: Unbind kitten texture
+// glBindTexture(GL_TEXTURE_2D, 0);
+
+// // TASK 10: set the texture.frag uniform for our texture
+// glUseProgram(m_texture_shader);
+// glUniform1i(glGetUniformLocation(m_texture_shader, "sampler"), 0);
}
void ARAP::update(double seconds)