summaryrefslogtreecommitdiff
path: root/src/arap.cpp
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2024-05-09 15:29:13 -0400
committersotech117 <michael_foiani@brown.edu>2024-05-09 15:29:13 -0400
commit0d6b3ded83f583a858368b1bbceda60ba65453a2 (patch)
tree9cb4f3aefc3c65492f61fac03498c220f2ef816c /src/arap.cpp
parent3d9a55316dbcfb2ca1f32f5554d1948fcabb5d74 (diff)
fix spacing on wave, fix normals and displacement, add retiling
Diffstat (limited to 'src/arap.cpp')
-rw-r--r--src/arap.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/arap.cpp b/src/arap.cpp
index 2f10849..729de07 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);
@@ -102,10 +102,16 @@ 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_shape.setVertices_and_Normals(m_ocean.get_vertices(), m_ocean.getNormals());
- m_shape.setVertices(m_ocean.get_vertices());
+ m_ocean.fft_prime(m_time);
+ m_ocean.update_ocean();
+ // std::cout << "updating ocean" << std::endl;
+ auto tmp = m_ocean.get_vertices();
+ // print the vertex
+// std::cout << "faces\t" << m_ocean.get_faces().size() << std::endl;
+// std::cout << "noormals\t" << m_ocean.getNormals().size() << std::endl;
+// std::cout << "vertices\t" << tmp.size() << std::endl;
+ m_shape.setVertices_and_Normals(m_ocean.get_vertices(), m_ocean.getNormals());
+ // m_shape.setVertices(m_ocean.get_vertices());
m_time += m_timestep;