Skip to content

Commit 64438f9

Browse files
committed
Some more comments.
1 parent 500cfb0 commit 64438f9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/deform_sphere.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
are unconstrained.
1414
*/
1515

16-
17-
1816
// Include as-rigid-as-possible deformation algorithm
1917
#include <deform/arap.h>
2018

@@ -60,15 +58,17 @@ int main(int argc, char **argv) {
6058
Mesh::VertexHandle va = mesh.vertex_handle(37);
6159
arap.setConstraint(va.idx(), deform::convert::toEigen(mesh.point(va)));
6260

61+
// Motion related variables
6362

64-
// Motion related variables.
6563
Mesh::Point p = mesh.point(mesh.vertex_handle(32));
6664
double pi = -M_PI_2;
6765
double add = 0.01;
6866

6967
// Create an OSG viewer to visualize incremental deformation.
7068
deform::example::OSGViewer viewer(argc, argv, mesh, [&p, &pi, &add, &arap](Mesh &mesh, double time) {
7169

70+
// Update motion
71+
7272
pi += add;
7373
if (std::abs(pi) > M_PI_2) {
7474
add *= -1.0;
@@ -78,11 +78,13 @@ int main(int argc, char **argv) {
7878
// Set handles. Semantically handles are vertices that are dragged around by some motion. Note,
7979
// although semantically they have a different meaning conceptually its the same as pinning a vertex
8080
// to a location.
81+
8182
Mesh::VertexHandle vh = mesh.vertex_handle(32);
8283
arap.setConstraint(vh.idx(), deform::convert::toEigen(p + Mesh::Point(0, 0, (float)(std::sin(pi)))));
8384

8485
// Run the algorithm for 5 iterations. Usually enough when the target constrain locations are not
8586
// far from the initial locations. Mesh is automatically updated when method completes.
87+
8688
arap.deform(5);
8789

8890
return true;

0 commit comments

Comments
 (0)