summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Park <SebPark03@gmail.com>2024-05-09 17:32:19 -0400
committerSebastian Park <SebPark03@gmail.com>2024-05-09 17:32:19 -0400
commitf1230ea24dc87a3bb5c9c709d4571e3298d7d07f (patch)
tree99773c557a199bf8f79a84e9cb711d7dae55dfa1 /src
parent3d9a55316dbcfb2ca1f32f5554d1948fcabb5d74 (diff)
Render normals to the ocean floor.
Diffstat (limited to 'src')
-rw-r--r--src/arap.cpp42
-rw-r--r--src/arap.h4
2 files changed, 4 insertions, 42 deletions
diff --git a/src/arap.cpp b/src/arap.cpp
index 2f10849..e1ab1ca 100644
--- a/src/arap.cpp
+++ b/src/arap.cpp
@@ -51,42 +51,6 @@ void ARAP::init
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)
@@ -104,12 +68,12 @@ void ARAP::update(double seconds)
// the last update
m_ocean.fft_prime(m_time);
- // m_shape.setVertices_and_Normals(m_ocean.get_vertices(), m_ocean.getNormals());
- m_shape.setVertices(m_ocean.get_vertices());
+// m_shape.setVertices_and_Normals(m_ocean.get_vertices(), m_ocean.getNormals());
+ m_shape.setVertices(m_ocean.get_vertices());
m_time += m_timestep;
- // std::cout << m_time << std::endl;
+// std::cout << m_time << std::endl;
}
// Move an anchored vertex, defined by its index, to targetPosition
diff --git a/src/arap.h b/src/arap.h
index 331cc3d..7c8c76a 100644
--- a/src/arap.h
+++ b/src/arap.h
@@ -38,8 +38,6 @@ public:
void draw(Shader *shader, GLenum mode)
{
-
-
m_shape.draw(shader, mode);
}
@@ -84,7 +82,7 @@ public:
ocean_alt m_ocean;
double m_time = 0.00;
- double m_timestep = 0.03;
+ double m_timestep = 0.1;
Eigen::Vector3f minCorner, maxCorner;
};