Skip to content

josephto/Project3-Simulation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation


CIS565: Project 3: Simulations ------------------------------------------------------------------------------- Fall 2013 -------------------------------------------------------------------------------
INTRODUCTION: ------------------------------------------------------------------------------- This project is a two part project. The first project a 3D visualization of an N-Body system simulated using CUDA and OpenGL shaders. The second part was a simple flocking simulation based largely on this paper: http://www.red3d.com/cwr/boids/
PART I: N-BODY SIM -------------------------------------------------------------------------------

This part of the project is rather straightforward. Here are a few screen shots.

![planet sim](https://raw.github.com/josephto/Project3-Simulation/master/Part1/PlanetSim1.png "screen shot") ![planet sim](https://raw.github.com/josephto/Project3-Simulation/master/Part1/PlanetSim2.png "screen shot")
PART II: FLOCKING SIM -------------------------------------------------------------------------------

For this part of the project, I implemented a simple flocking simulation. I added in alignment, separation, cohesion, and a spherical boundary avoidance force that kept the particles within the frame of the window. Here are a few screenshots:

![flocking sim](https://raw.github.com/josephto/Project3-Simulation/master/Part2/Flocking1.png "screen shot") ![flocking sim](https://raw.github.com/josephto/Project3-Simulation/master/Part2/Flocking2.png "screen shot")

Here's a video of my flocking simulation in action. I apologize for the poor quality: http://www.youtube.com/watch?v=Ypkwl0yjSD8


PERFORMANCE REPORT: -------------------------------------------------------------------------------

Here's a table with some performance analysis that I conducted on my code. I recorded how many seconds for one update/frame of the simulation to occur when I used naive force accumulation over all the planets in the system compared to using shared memory.

Number of Planets Without Shared Memory With Shared Memory
1000 0.001 sec 0.001 sec
2000 0.003 sec 0.002 sec
3000 0.005 sec 0.004 sec
4000 0.008 sec 0.008 sec
5000 0.012 sec 0.010 sec
6000 0.015 sec 0.013 sec
7000 0.019 sec 0.018 sec
8000 0.025 sec 0.022 sec
9000 0.042 sec 0.038 sec

As you can see, shared memory is faster but only slightly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 53.7%
  • C++ 46.1%
  • CSS 0.2%