Final Project -- Simulated Rope Bridge

This is my final project for Computer Graphics. It is a simulation of a rope bridge easing under its own weight.

The bridge is constructed from a lattice of vertices which are connected by springs. At each animation frame the simulator calculates the force of all the adjacent vertices pulling on it and also adds gravity. The four corner nodes are unaffected by the forces so they stay put. The position of the rope linkages is done by a super-basic inverse kinematics routine which just figures out how to rotate a cylinder so that it is between two adjacent vertices. I originally intended to have a lot more linkages but, the simulator gets too slow and the inverse kinematics routine goes haywire.

To make this run a little faster I am storing the edges and forces on the lattice in an adjacency matrix so that any pair-wise force needs only be calculated once.

The lattice object underneath can actually be drawn as a shaded figure, but I'm not doing that here since it's a rope bridge!

Controls

  • Click and drag the mouse to rotate the scene.
  • Use UP/DOWN arrow keys to increase/decrease the effect of gravity


This work is being done as part of Professor Ken Perlin's Graduate Computer Graphics Course (G22.2270-001) at NYU.

Source code:
RopeBridge.java extends World.java
Lattice.java extends Shape3D.java
Material.java
Cylinder.java
Shape3D.java
Phong.java
Light.java
Vertex.java
Vector3D.java
Matrix.java
Matrix3D.java
MatrixStack.java
Polygon.java