John Baden / Daniel Luna CMPS160 Final Project
Demolition Particle Effects

Description

Our project focuses on generating efficient particle dynamics with a flat reflective and volumetrically transparent body of water. Namely, we use a conical explosion to give a series of bricks appropriate velocity and rotation, then generate appropriate splashes and reflections as time progresses. The conical explosion is user manipulated with variable strength, angle, falloff, etc. The body of water in question is flat so as to create simpler mathematics, and the splashes are created by generating small spherical droplets with random upward velocity.

User Guide

Using our program is easy! Use the sliders at the bottom of the window to manipulate the angle, magnitude, source (sX, sY, sZ) and direction (dX, 1, dZ) of the conical explosion. Once you manipulate the sliders to as desired, press play to start the simulation. You can pause the simulation at any time by pressing the play button again. Alternatively, you can drag the slider under the play button to view the simulation frame by frame. The simulation will automatically update as the settings are changed without the need to restart or pause the simulation.

Here is a link to the project itself!


Technical Details

A majority of the algorithms for this project are based in useful physics equations. The movement was generated with simple kinematic equations. The bricks were considered to have 1 kg of mass to keep the equations simple. The rotation of any brick was determined using only one axis of rotation, along with a given angular velocity to determine how far to rotate about that axis at any given point in time. The origins of the bricks were hard-coded, and the origins of the splashes were found by intersecting movement path of a brick with the surface of the water. Thus, the hardest part about the motion of the particles was generating the initial velocity of the bricks.

First we checked which bricks lay inside the cone defined by the user. Using the inverse cosine of the dot product between the vector from the source of the explosion extending outward in the diretion given, with the vector from the explosion's source to the center of mass of the brick in question. Our force field decreased with the distance squared to the explosion, and also decreased in force as one moved away from the cone's major axis (another effect achieved with dot products). In order to calculate the rotation of the bricks, we simplified our explosion to a simple spherical explosion which simply worried about the decrease due to the distance from the major axis, and found the curl of that field at the point in question.

Finally, we could not get transparency to work properly, so we faked our own. As bricks fall below the water level, they are blended with the color of the water directly in the shader. For reflections, we first reflected the object about the surface of the water. Then we projected it along the vector to the camera until it hit the surface of the water. These reflections were also partially transparent.