Project 2d - Level of Detail.
Goal: The goal of this phase of the project was to create models using different levels of detailing.
The overall objective will be to use lower detail models at further distances, where detail will not easily be
noticed. This will have the ultimate effect of increasing performance as the number of triangles that
needs to be rendered is reduced.
Demo Videos:
(click to open)
Demo video of the crowd with different levels of detail. (9.1 MB, DivX Required)
Movie of level of detail changing with distance. (2.4 MB, DivX Required)
Movie of the five different level of details manually changed (close up). (1.2 MB, DivX Required)
An example of a person navigating an obstacle. (1.6 MB, DivX Required)
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.
Calculating Level of Detail: In order to calculate the meshes for different level of detail, I started out my constructing bounding boxes around the models. I then subdivided each rectangular prism, using different levels of subdivision for different levels of detail. I then iterated through the vertex list and determined which vertices were located in each subdivided cube, using:
cell(i) = round(nx*x/xmax)
cell(j) = round(ny*y/ymax)
cell(k) = round(nz*z/zmax)
After this I determined a representative vertex contained within each subdivided cube. I did this by averaging each vertex and using the average as the final vertex. I then did another pass through this vertex list and removed all vertices that created zero area triangles.
Crowd Simulator: For the crowd simulator I decided to just test the whole crowd with manually controlled levels of detail in order to fine tune performance. For the next phase the level of detail will be manually controlled based on the distance from the figure to the camera (as seen in this demo video). I also improved the performance of obstacle navigation. In the previous phase the minimum non-colliding point was not being calculated correctly, but now the walkers move around obstacles quite nicely.
Performance: I found that I could run the simulation at 10 frames per second with the following level of detail and crowd combinations on an Intel P4 3.06 GHz with ATI Radeon 9700 graphics card:
level of detail 1 = 30 people
level of detail 2 = 25 people
level of detail 3 = 20 people
level of detail 4 = 15 people
level of detail 5 = 7 people
Files:
All Applet Files (1 MB zip) - p2d.zip
Applet Source Code - p2d.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)
Demo Pictures:
(click to enlarge)
First level of detail.
Second level of detail.
Third level of detail.
Fourth level of detail.
Fifth level of detail.
Demo Videos:
(click to open)
Demo video of the crowd with different levels of detail. (9.1 MB, DivX Required)
Movie of level of detail changing with distance. (2.4 MB, DivX Required)
Movie of the five different level of details manually changed (close up). (1.2 MB, DivX Required)
An example of a person navigating an obstacle. (1.6 MB, DivX Required)
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.
Calculating Level of Detail: In order to calculate the meshes for different level of detail, I started out my constructing bounding boxes around the models. I then subdivided each rectangular prism, using different levels of subdivision for different levels of detail. I then iterated through the vertex list and determined which vertices were located in each subdivided cube, using:
cell(i) = round(nx*x/xmax)
cell(j) = round(ny*y/ymax)
cell(k) = round(nz*z/zmax)
After this I determined a representative vertex contained within each subdivided cube. I did this by averaging each vertex and using the average as the final vertex. I then did another pass through this vertex list and removed all vertices that created zero area triangles.
Crowd Simulator: For the crowd simulator I decided to just test the whole crowd with manually controlled levels of detail in order to fine tune performance. For the next phase the level of detail will be manually controlled based on the distance from the figure to the camera (as seen in this demo video). I also improved the performance of obstacle navigation. In the previous phase the minimum non-colliding point was not being calculated correctly, but now the walkers move around obstacles quite nicely.
Performance: I found that I could run the simulation at 10 frames per second with the following level of detail and crowd combinations on an Intel P4 3.06 GHz with ATI Radeon 9700 graphics card:
level of detail 1 = 30 people
level of detail 2 = 25 people
level of detail 3 = 20 people
level of detail 4 = 15 people
level of detail 5 = 7 people
Files:
All Applet Files (1 MB zip) - p2d.zip
Applet Source Code - p2d.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)
Demo Pictures:
(click to enlarge)
First level of detail.
Second level of detail.
Third level of detail.
Fourth level of detail.
Fifth level of detail.