-
Notifications
You must be signed in to change notification settings - Fork 65
Physical Simulation
The next task is to implement an integrator for the (undamped) wave equation across a mesh:
We've discussed in class how to calculate the Discrete Laplacian operator, via the cotan-formula:
There is an additional note for evaluating this cotangent here: Evaluating cotan
For this task, you should update Vertex::Laplacian
in halfedgeMesh.cpp
and Mesh::forwardEuler
and Mesh::symplecticEuler
in dynamic_scene/mesh.cpp
, storing your calculated u
value in Vertex::offset
and the calculated u'
value in Vertex::velocity
. Be careful about when you update these quantities. Note that since forward Euler is defined to solve a single, first-order differential equation, solving a second-order one will require you to break it up into 2 first order equations and solve each of them with forward Euler.
The next task is to change your intergrators to solve the damped wave equation across a mesh: Where we call the damping factor, which can take on any value between 0 and 1. You'll notice here that a damping factor of 0 is identical to the undamped case.
Once you've implemented these integrators, you can switch between them with F
and S
, change the timestep with -
and =
, and the damping factor with SHIFT/-
and SHIFT/=
. Be aware that Forward Euler is not numerically stable, so if your solutions blow up then it's the expected behavior.
You may find it easier to initially test this behavior on one of the simpler meshes from media/meshedit
. The images below show a sample output on bean.dae
at the 10th and 100th frame of animation, note that the damping factor of 0.01 causes the waves to dissipate.
- Task 1: Camera Rays
- Task 2: Intersecting Primitives
- Task 3: BVH
- Task 4: Shadow Rays
- Task 5: Path Tracing
- Task 6: Materials
- Task 7: Environment Light
Notes:
- Task 1: Spline Interpolation
- Task 2: Skeleton Kinematics
- Task 3: Linear Blend Skinning
- Task 4: Physical Simulation
Notes: