Project 2e - Integrated 3D Crowd Simulator.
Goal: The goal of this phase of the project was to tie all the pieces from previous phases together into a working 3D crowd simulator. The simulator will offer different levels of detail so that it can be run with a performance of at least 10 frames per second.

Tools Used: My project was written on Windows XP. I used IronCAD for the 3D Modeling and Processing 0095 Beta (http://processing.org) for the viewer.

demo picture

Demo Videos:
demo.avi - 10 MB, DivX Required.

Putting it all together: When my applet runs initially there are 5 people in the crowd at a medium level of detail. This gives an acceptable quality view of each triangle mesh model. Each walker has four frames of animation that animate when the figure is in motion. Each figure has a goal, which is represented by a sphere of the same color as the walker. Each walker has a random size and speed, varying from slow to fast. The obstacles for each walker are the other people in the crowd, and they have to navigate around the moving figures in order to reach their goal. As more people are added to the room, it becomes necessary to lower the level of detail to maintain the performance goal of 10 frames per second.

Performance Bottlenecks: I found that the biggest performance bottleneck was simply drawing all of the triangles for each model. I wanted to experiment with triangle fan or stripe shapes, but I never got a working implementation of those shapes in order to compare the performance outcomes. There also seems to be a bottleneck when computing the next point for each character. Since I do not use level maps, but rather compute the next step on the fly during each frame, this takes a little bit of computing power and slows down the animation when there are many people in the crowd. I found that as long as the crowd is kept below about 15 people and the level of detail isn't too high, ten frames per second is easily achieved.

Improvements: The one thing I didn't get to implement that I would have liked to is walker control. If I would have done this, I would have created a 3D selection method that took an image when the mouse was clicked. As long as each walker used a different color, it would be trivial to figure out which walker was selection. Then the arrow keys could have been used to control the walker's direction. Another thing which I would like to implement in the future is obstacles besides the other people in the crowd.

Files:
All Applet Files (1 MB zip) - p2e.zip
Applet Source Code - p2e.pde

Applet Instructions: the applet must be "clicked on" to activate key controls.
Use the mouse to rotate the view.
Press + and - to zoom in and out.
Press A and S to change the size of the crowd.
Press Z and X to change the level of detail.

Applet:
(might take a minute to load)
To view this content, you need to install Java from java.com
Copyright Info :: W3C :: CSS