summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2024-04-09 22:48:26 -0400
committersotech117 <michael_foiani@brown.edu>2024-04-09 22:48:26 -0400
commit10619e114973276f783db40329b436082525dce3 (patch)
tree5c0cf96da16214dc80f960d9448a0bcd871c097c /src
parentfd19124693bb32835ad97802ba1950cd5202dbd2 (diff)
fix small bugs, remove vertices points for demo rendering
Diffstat (limited to 'src')
-rw-r--r--src/arap.cpp2
-rwxr-xr-xsrc/glwidget.cpp16
-rw-r--r--src/ocean/ocean.cpp3
-rw-r--r--src/ocean/ocean.h8
4 files changed, 15 insertions, 14 deletions
diff --git a/src/arap.cpp b/src/arap.cpp
index 3ebdf64..8b3fedc 100644
--- a/src/arap.cpp
+++ b/src/arap.cpp
@@ -67,7 +67,7 @@ void ARAP::update(double seconds)
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/glwidget.cpp b/src/glwidget.cpp
index 2a7a452..98d8924 100755
--- a/src/glwidget.cpp
+++ b/src/glwidget.cpp
@@ -121,14 +121,14 @@ void GLWidget::paintGL()
glClear(GL_DEPTH_BUFFER_BIT);
- m_pointShader->bind();
- m_pointShader->setUniform("proj", m_camera.getProjection());
- m_pointShader->setUniform("view", m_camera.getView());
- m_pointShader->setUniform("vSize", m_vSize);
- m_pointShader->setUniform("width", width());
- m_pointShader->setUniform("height", height());
- m_arap.draw(m_pointShader, GL_POINTS);
- m_pointShader->unbind();
+// m_pointShader->bind();
+// m_pointShader->setUniform("proj", m_camera.getProjection());
+// m_pointShader->setUniform("view", m_camera.getView());
+// m_pointShader->setUniform("vSize", m_vSize);
+// m_pointShader->setUniform("width", width());
+// m_pointShader->setUniform("height", height());
+// m_arap.draw(m_pointShader, GL_POINTS);
+// m_pointShader->unbind();
}
void GLWidget::resizeGL(int w, int h)
diff --git a/src/ocean/ocean.cpp b/src/ocean/ocean.cpp
index eabaa8e..bb33106 100644
--- a/src/ocean/ocean.cpp
+++ b/src/ocean/ocean.cpp
@@ -196,7 +196,7 @@ std::pair<double, double> ocean::amplitude_t
// get dispersion from k
std::pair<double, double> k = k_index_to_k_vector(k_index);
double k_magnitude = sqrt(k.first * k.first + k.second * k.second);
- double omega = omega_dispersion(k_magnitude);
+ double omega = omega_dispersion(k_magnitude, true);
// calculate the complex exponential terms
double omega_t = omega * t;
@@ -234,6 +234,7 @@ std::vector<Eigen::Vector3f> ocean::get_vertices()
//if (i < length)
double amplitude = current_h[i].first;
+ // double amplitude = sqrt(current_h[i].first * current_h[i].first + current_h[i].second * current_h[i].second);
// if (i < length) amplitude = initial_h[i].first;
diff --git a/src/ocean/ocean.h b/src/ocean/ocean.h
index a576c44..2387d2a 100644
--- a/src/ocean/ocean.h
+++ b/src/ocean/ocean.h
@@ -23,12 +23,12 @@ public:
private:
- const int length = 32; // length of grid
- const int width = 32; // width of grid
+ const int length = 81; // length of grid
+ const int width = 81; // width of grid
const int N = length * width; // total number of grid points
- const double A = 10; // numeric constant for the Phillips spectrum
- const double V = 5.0; // wind speed
+ const double A = 10.0; // numeric constant for the Phillips spectrum
+ const double V = .25; // wind speed
const std::pair<double, double> omega_wind
= std::make_pair(1.0, 0.0); // wind direction