SLIDE 5 VL: Vector library
- VL provides a set of vector and matrix classes, as
well as a number of functions for performing arithmetic with them
- Most arithmetic operators and functions for vectors
and matrices are supported (+, -, *, /, dot(), len(), cross(), trans(), inv(), etc)
- VL also provides two linear system solvers:
SolveOverRelax() and SolveConjGrad()
- Include “VLd.h” in your code
Hooking up to basic particle system
- Constraint forces are calculated after ordinary forces
and before updating the derivative of the current state
computeForcesAndUpdateParticles()
Mouse interaction
- Each time the mouse button and the shift key are
pressed at the same time, find the particle closest to the mouse and apply the force directly on that particle
- Apply an attractive spring force between the particle
and the mouse until the button is released
- Add code in ModelerView::handle() to catch the
event when left button and the shift key are pushed
- Create and delete “mouse forces” on the fly
Experiments
- Add feedback term to the constraint acceleration
- Play with the coefficients ks and kd to find the
- ptimal values
- Do these experiments from the UI, instead of
recompiling the entire code every time you change the coefficients
¨ C = −ksC − kd ˙ C