summaryrefslogtreecommitdiff
path: root/src/arap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/arap.cpp')
-rw-r--r--src/arap.cpp41
1 files changed, 32 insertions, 9 deletions
diff --git a/src/arap.cpp b/src/arap.cpp
index 9bfbd27..6239f83 100644
--- a/src/arap.cpp
+++ b/src/arap.cpp
@@ -34,7 +34,7 @@ void ARAP::init
// if (MeshLoader::loadTriMesh(m_mesh_path, vertices, triangles)) {
// m_shape.init(vertices, triangles);
// }
-
+ m_ocean.update_ocean();
vertices = m_ocean.get_vertices();
triangles = m_ocean.get_faces();
m_shape.init(vertices, triangles);
@@ -51,8 +51,20 @@ void ARAP::init
coeffMin = all_vertices.colwise().minCoeff();
coeffMax = all_vertices.colwise().maxCoeff();
- minCorner = coeffMin;
- maxCorner = coeffMax;
+// minCorner = coeffMin;
+// maxCorner = coeffMax;
+//
+ std::cout << "minCorner: " << minCorner << std::endl;
+ std::cout << "maxCorner: " << maxCorner << std::endl;
+//
+// minCorner = Vector3f(0.0f, 0.0f, 0.0f);
+// maxCorner = Vector3f(1.0f, 0.0f, 1.0f);
+//
+// std::cout << "minCorner: " << minCorner << std::endl;
+// std::cout << "maxCorner: " << maxCorner << std::endl;
+//
+// minCorner = Vector3f(-1.0f, -1.0f, -1.0f);
+// maxCorner = Vector3f(1.0f, 1.0f, 1.0f);
// m_shape.initGroundPlane("cornell_box_full_lighting.png")
@@ -104,13 +116,24 @@ void ARAP::update(double seconds)
// Note that the "seconds" parameter represents the amount of time that has passed since
// the last update
+ m_ocean.fft_prime(m_time);
+ m_ocean.update_ocean();
+ m_shape.setVertices_and_Normals(m_ocean.get_vertices(), m_ocean.getNormals());
+ // m_shape.setVertices(m_ocean.get_vertices());
+
+ auto tmp = m_ocean.get_vertices();
+ // print the min and max of the vertices
+ Vector3f min = Vector3f::Ones() * 1000000;
+ Vector3f max = Vector3f::Ones() * -1000000;
+ for (int i = 0; i < tmp.size(); i++) {
+ min = min.cwiseMin(tmp[i]);
+ max = max.cwiseMax(tmp[i]);
+ }
+ std::cout << "min: " << min << std::endl;
+std::cout << "max: " << max << std::endl;
- 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());
-
- FoamConstants foam = m_ocean.getFoamConstants();
- m_foam_shape.setFoamInputs(m_shape.getVertices(), foam.wavelengths, foam.k_vectors, foam.texCoords);
+ FoamConstants foam = m_ocean.getFoamConstants();
+ m_foam_shape.setFoamInputs(m_shape.getVertices(), foam.wavelengths, foam.k_vectors, foam.texCoords);
m_time += m_timestep;