Welcome to the site of Max Aubrey Wagner, 3D Game and Simulations Programmer |
/Projects/Springs |
Download the project executable (.zip archive)
Requirements: PC/Windows, DirectX 9 Runtime, NVIDIA GeForce3-ti or equivalent ATI graphics card,
supporting DirectX Vertex Shader version 1.1 and Pixel Shader version 1.1.
This project demonstrates the physically-based modeling techniques of Newtonian dynamics, both linear and angular, through a linear spring-mass-damper system anchored at two moveable points.
Specifically, three types of forces are modeled: gravitational, spring (coupled with damping), and frictional drag.
Gravitational force is implemented in a very straightforward manner using a dynamically settable constant of gravity in the Y world direction. This force is applied once to each object per frame.
Similarly, frictional air drag is implemented using a dynamically settable constant which acts in a direction opposing an object's world velocity.
The spring force is implemented using Hooke's Law, F = -kx, and adds a damping force propotional to the relative velocities of the spring's two attached end-points. The spring force also takes into account the spring's 'at-rest' length (does not assume the spring's length is 0).
For numerical integration, the force values for a given frame are stored in such a manner as to allow for re-computation at partial integration steps using intermediate velocity, position, rotation (etc.) values. I settled on using an improved-Euler/midpoint integration method, using two Euler-style steps per-frame to compute the final physical values for the frame as used for rendering.
Website copyright (c) 2004-2005 Max Wagner, all rights reserved.
All project and game content copyright (c) 2005 DigiPen (USA) Corporation, all rights reserved.