Project 1: Particle System The Animation of Natural Phenomena Due 10/18

Similar documents
Assignment 1: Mass-Spring System

Cloth Simulation. COMP 768 Presentation Zhen Wei

A simple example. Assume we want to find the change in the rotation angles to get the end effector to G. Effect of changing s

Ragdoll Physics. Abstract. 2 Background. 1 Introduction. Gabe Mulley, Matt Bittarelli. April 25th, Previous Work

Navier-Stokes & Flow Simulation

Navier-Stokes & Flow Simulation

Mass-Spring Systems. Last Time?

Agenda. Introduction Curve implementation. Particle System. - Requirements -What are all those vectors? -Where should I put things?

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg

GSim An Interactive Gravity Simulator

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Physics Tutorial 2: Numerical Integration Methods

Physically based modelling Computer Graphics I February 27, 2003

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

The Jello Cube Assignment 1, CSCI 520. Jernej Barbic, USC

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg

Physically Based Simulation

The jello cube. Undeformed cube. Deformed cube

Numerical Integration

Physically Based Simulation

Applications. Human and animal motion Robotics control Hair Plants Molecular motion

Cloth Hair. and. soft bodies

Dynamics in Maya. Gary Monheit Alias Wavefront PHYSICALLY BASED MODELING SH1 SIGGRAPH 97 COURSE NOTES

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation

Chapter 19- Object Physics

Fundamentals of Computer Animation

Navier-Stokes & Flow Simulation

Final Exam CS 184: Foundations of Computer Graphics page 1 of 14 Fall 2016 Prof. James O Brien

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report

Time Line For An Object. Physics According to Verlet. Euler Integration. Computing Position. Implementation. Example 11/8/2011.

Particle Systems. Lecture 8 Taku Komura

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

Introduction to Computer Graphics. Animation (2) May 26, 2016 Kenshi Takayama

Computer Animation III

PPGCC Linha de Pesquisa SIV Disciplina: Animação Computadorizada. Profª. Drª. Soraia Raupp Musse Pós-doc Dr Leandro Dihl 12/05/2015

Cloth and Hair Collisions

4 Visualization and. Approximation

Appendix E Calculating Normal Vectors

Water. Notes. Free surface. Boundary conditions. This week: extend our 3D flow solver to full 3D water We need to add two things:

Name: SID: LAB Section:

Exam 2 Preparation Math 2080 (Spring 2011) Exam 2: Thursday, May 12.

Lecture 5 2D Transformation

Particle Systems. Sample Particle System. What is a particle system? Types of Particle Systems. Stateless Particle System

The exam begins at 5:10pm and ends at 8:00pm. You must turn your exam in when time is announced or risk not having it accepted.

Particle Systems. g(x,t) x. Reading. Particle in a flow field. What are particle systems? CSE 457 Winter 2014

CS354 Computer Graphics Rotations and Quaternions

Last Time? Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

How to create a network diagram?

Modeling Cloth Using Mass Spring Systems

QP-Collide: A New Approach to Collision Treatment

PHYSICALLY BASED ANIMATION

HW #7 Solution Due Thursday, November 14, 2002

COMS W1007 Homework 4

Cloth Simulation on GPU

How To Implement a Pressure Soft Body Model

Interactive Real Time Cloth Simulation with Adaptive Level of Detail

CSE 490R P1 - Localization using Particle Filters Due date: Sun, Jan 28-11:59 PM

Fast Simulation of Mass-Spring Systems

CISC 1600, Lab 2.3: Processing animation, objects, and arrays

Inverse Kinematics Programming Assignment

CS 775: Advanced Computer Graphics. Lecture 3 : Kinematics

Lab 3: Simple Firewall using OpenFlow

Last Time? Animation, Motion Capture, & Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

Designing and Implementing a Dynamic Camera System

Virtual Marionettes: A System and Paradigm for Real-Time 3D Animation

Lesson 1: Introduction to Pro/MECHANICA Motion

Question 2: Linear algebra and transformations matrices rotation vectors linear transformation T=U*D*VT

Nature of Code. Patrick Dwyer Fall 2005 Week 4 - September 27 th

FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016

MA 113 Calculus I Fall 2015 Exam 2 Tuesday, 20 October Multiple Choice Answers. Question

2D/3D Geometric Transformations and Scene Graphs

A simple OpenGL animation Due: Wednesday, January 27 at 4pm

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Last Time? Animation, Motion Capture, & Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

Math 133A, September 10: Numerical Methods (Euler & Runge-Kutta) Section 1: Numerical Methods

1) Find. a) b) c) d) e) 2) The function g is defined by the formula. Find the slope of the tangent line at x = 1. a) b) c) e) 3) Find.

Pong in Unity a basic Intro

An Analysis of Interactive Deformable Solid Object Modeling

COMP 175 COMPUTER GRAPHICS. Lecture 10: Animation. COMP 175: Computer Graphics March 12, Erik Anderson 08 Animation

ROSE-HULMAN INSTITUTE OF TECHNOLOGY

Homework 2 Questions? Animation, Motion Capture, & Inverse Kinematics. Velocity Interpolation. Handing Free Surface with MAC

Trigonometry Final Review Exercises

CSE 21 Spring 2016 Homework 5. Instructions

CS 130 Final. Fall 2015

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion?

5.1. Examples: Going beyond Sequence

Cloth The Animation of Natural Phenomena Adrien Treuille

Simulation of curly hair

Solution 2. ((3)(1) (2)(1), (4 3), (4)(2) (3)(3)) = (1, 1, 1) D u (f) = (6x + 2yz, 2y + 2xz, 2xy) (0,1,1) = = 4 14

AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO F ^ k.^

Interactive Computer Graphics

Eric Schenk, EA August 2009

Tutorial: Getting Started with the LabVIEW Simulation Module

CS4621/5621 Fall Particle Systems and Compute Shaders

Game Mathematics. (12 Week Lesson Plan)

SolidWorks Motion Study Tutorial

Inverse Kinematics (part 1) CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2018

MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras

True/False. MATH 1C: SAMPLE EXAM 1 c Jeffrey A. Anderson ANSWER KEY

Modeling Structural - Dynamics Systems in MODELICA/Dymola, MODELICA/Mosilab and AnyLogic

Transcription:

Project 1: Particle System The Animation of Natural Phenomena Due 10/18 In this project you will implement a particle system with constraints. You must implement at least the required features. You must also record a video artifact of your system in action. The class will vote on the best artifacts, and the top three winners will receive extra credit. Additionally, you may implement some of the listed extensions (or invent your own!) for extra credit. Be sure to check out great previous submissions from 2008, and 2010! Skeleton Code: You have been provided with some skeleton code which you may use to jump-start your coding. Basically, the only thing the code does is move three particles around randomly, and draw some (nominal) constraints and spring between them. This code does little more than implement basic window management and graphics, but this stuff is very annoying to do alone. Required Features: Your code must implement the following features: A generalized force structure. This is described in the slides. (If youʼre using the skeleton code, you should replace delete_this_dummy_spring with a std::vector of forces.) You must implement two subclass forces: GravityForce. Acts like gravity. SpringForce. A damped spring between two particle. Skeleton rendering code is already provided. A generalized constraint structure. This is also described in the slides. (If youʼre using the skeleton code, you should replace delete_this_dummy_rod and delete_this_dummy_wire with a std::vector of forces.) You must implement at least the following two subclasses: RodConstraint. Constrains two particles to be a fixed distance apart. (Rendering code included in the skeleton.) " " C(x1, y1, x2, y2) = (x1 - x2) 2 + (y1 - y2) 2 - r 2 CircularWireConstraint. Constrains a particle to be a fixed distance from some point: " " C(x, y) = (x - xc) 2 + (y - yc) 2! - r 2 1

Mouse interaction. When the user clicks and drags the mouse, a spring force should be applied between the mouse position and the given particle to make your system interactive. Several Numerical Integration Schemes (Simulators). The integration scheme should be selectable at runtime with keystrokes or some other interaction paradigm. You will find this easiest if you implement a pluggable integration architecture as described in the slides. The minimum integration schemes are: Euler Runge-Kutta 2 Runge-Kutta 4 Optional Features: You demo must be able to turn each of these features on and off individually so they can be verified. Verlet Integrator. See here. Leapfrog Integrator. Evaluates position and velocity at different times. See here for more details. Symplectic Integrator. As described in class. Compute the positions explicitly and velocities implicitly. (No need for a solver.) Collisions with the Walls. Particles should bounce off the walls and floor. Collisions with other Particles. Particles bounce off each other. Angular Springs. Pulls a triplet of particles so that their subtending angle approaches some rest angle. Angular Constraints. Like angular springs, but the angle is actually constrained. 3D. Implement and render this algorithm in 3D. 2D Cloth. Create a rectangular network of particles with appropriate springs holding it together. Which spring configurations work best, which donʼt work? Implicit Integration. In order to implement the linear solver, you can use the linearsolver.* code in the skeleton code. (Note that it must be added to the makefile before you can use it.) See the course notes here. 3D Cloth. 3D Cloth with collisions Hair with collisions. 2

Deliverables: Code. At 11:59:59 on the due date, you must submit zip file or tarball of the code that builds on the instructional Linux system. The code must be mailed to me at treuille@cs.cmu.edu with Project 1 Submission in the subject line. The code must be directly included in the e-mail (no Dropbox or USendIt). Readme. The code should include a readme.txt stating how to run your program, listing any special features or instructions, and clearly identifying parts of assignment which were not completed, if any. Demo. After the due date, if you like, you may schedule a meeting with Jeehyung to demo your project to show of any special features. Artifact. You must submit a video of your system in action. Videos can be implemented in several ways. Usually the starting point is to dump frames (by hitting ʻdʼ in the skeleton implementation). These frames can be coalesced into a movie using several software packages (ImageMagick and ffmpeg on Linux, Quicktime Pro on Mac, and VirtualDub on Windows). Alternatively, you can use one of the new screen capture programs that are all the rage these days. 3

Further explanation of J and J / t (also known as J): J / t is the time derivative of the gradient matrix J of your constraints. For example if you had constraint: " C(x,y) = sin(x) + cos(y) - 1 then the gradient matrix would be: " J = [cos(x), -sin(y)] and its time derivative would be: " J / t = [-sin(x) x / t, -cos(x) y / t]. C 1 This example has four particles and four constraints. (That they be the same number is a coincidence.) The matrix product JWJ T can be computed by first multiplying by J T, then multiplying by the inverse mass matrix W, then finally multiplying by J. This gives you the right hand side of the equation: dc 1 dx 1 dc 2 dx 1 dc 2 dx 2 dc 3 x 3 dc 3 dx 2 dx 4 dc 4 dx 1 dc 4 dx 3 J Each dc/dx entry in this matrix is a row vector. C 4 x 1 1/w1 1/w1 C 2 x 2 1/w2 C 3 x 4 1/w2 1/w3 1/w3 W Each entry in this matrix is a scalar. JWJ T = J q JWQ k s C k d Ċ Note that none of these matrices need be computed explicitly. Instead, compute the J and J T matrices by iterating over the constraints and performing multiplies only for affected particles. Compute the inverse mass matrix by diving by the mass of each particle. This entire procedure can be wrapped into an implicit_matrix, then solved using the linear solver provided with the code package. 1/w4 1/w4 T dc1 dx1 T dc2 dx1 T dc2 dx2 T dc3 dx2 T dc3 dx4 J T Each dc/dx T entry in this matrix is a column vector. T dc4 dx1 T dc4 dx3 4

Analytic or Numerical Derivatives: Derivatives (i.e. gradients) should be computed analytically, not numerically. So there's no ε step approximaton. For example, your constraint abstract base class could have an abstract function of the form: gradient(double dcdx[3]) = 0; You should return the exact derivative. For example if your constraint is that the particle lie on a plane C(X) = dot(x, n) - p then the derivative would be dcdx(x) = n: void PlaneConstraint::gradient(double dcdx[3]) {! dcdx[0] = this->n[0];! dcdx[1] = this->n[1];! dcdx[2] = this->n[2]; } Note that the constraint class is computing the exact derivative. This information would then be used as in the following pseudocode: double dcdx[3]; for (int constraint_index = 0 ; constraint_index < nconstraints ; ++constraint_index) {! OneParticleConstraint * c = constraints[constraint_index];! c->gradient(dcdx);! constraint_jacobian->add_gradient(!! constraint_index,!! c->get_particle_index(),!! dcdx);! } Note that this is just an example, and many variations are possible, including replace the 3-length double arrays with gfx vector classes, etc. How to Pin Particles: If you are trying to "pin" a particle to be at point (a, b), you can just flag the particle rather than using constraints. Then at each timestep, set the particle's position to (a, b) and it's velocity and forces both to (0, 0). It can be shown that this is exactly equivalent to the pair of constraints: " C1(x) = x - a " C2(x) = x - b 5

You should especially not use the bead on a wire constraint with radius r=0, because this constraint will have a gradient discontinuity precisely where's it's satisfied, which is a bad thing, numerically. (Note that if you do this, you can t apply any other constraints to this particle, but why would you want to?) 6