CPSC 414 Assignment 3 Done by Michael Kirkby, and only Michael Kirkby This project falls into the catagory of graphically modeled simple physics What this program is all about: 0. This program is cool, it is fun. Please enjoy it. 1. This program models a grid of regularly spaced nodes of equal mass connected by springs of equal spring constant. Springs exist both on the grid axes, and on the diagonals. The physical dynamics of such a grid are simulated by an iterative difference equation. The time progression of the system can be toggled on and off. The nodes of the grid can be grabbed (by left clicking the mouse on them) and dragged to a new position. How this program operates - Programs controls: Keyboard q - terminate program - toggle time flow on/ off r - enable/ disable updating physical properties of grid while dragging a node -> simulate-while-draggin needs to be ON to be able to drag the entire sheet around => time advances one step per mouse motion when on; no time advance when off s - save current window image to .ppm file Mouse right button depress - toggle grid being overlayed onto image left button depress - selects a node if left button depressed while mouse is over a node's 'sensitive region' - boxed area around node which can be seen when the grid is turned on mouse drag with left depressed - moves a node (if it is selected)to the current mouse position Interesting properties of this grid particle system: 1. -each grid segment/ tile (section of grid formed by 4 immediately neighboring nodes) has two stable equilibria configuratoins (see item 5. in the info. on physics section) 2. -the grid/ sheet can be folded like a sheet of paper by exploiting the twisted and remain stable. With time turned off, manually drag an outter edge of nodes, one node at a time, inwards into the grid by 2 nodes spacings (i.e. skipping over it's nearest neighbor and landing on the neighbor's neighbor) 3. Although all the equations for the grid system remain in a plane (i.e. there is no z-compenent anywhere) the visual effect of the vibrating grid system gives the impression of 3D waves on the surface of a liquid volume, at least to me and some of my friends. This can better be seen with the grid turned off. Some info. on physics of system: 1. -each node only interacts with it's immediate neighbors, both on the grid and on the diagonals, via a simple spring approximation 2. -note that the equations of spring coupling between nodes has been modified from the most basic form ( F = -k(delta_x) ) to add more repulsion between nodes at close range 3. -energy can be added to system by stretching a node away from it's equilibrium point 4. -energy can be removed from system by grabbing a fast moving node (this sets it's new velocity to zero) and placing it closer to one of it's equilibrium points 5. -there are two stable equilibria for each 2 by 2 grid cell: one is the standard configuration which the grid starts in (each tile is a simple convex quadrilateral); the other stable equilibrium can be achieved by shifting a node across the cell and continuing outside the cell and placing it between two of it's opposite nodes, forming a six-sided, roughly figure-8 pattern. 6. -the edges of the window form frictionless, perfectly rigid walls containing the system of particles, i.e. particle do a perfect reflection when they collide with (bounce off) the walls About the code: -this program was developed from the gltexdemo code provided by the instructor