Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 26 commits into
base: feedback
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ba27c3f
Setting up GitHub Classroom Feedback
github-classroom[bot] Mar 14, 2024
b6b886a
initial commitment of readme.md
Luc1nd4 Mar 14, 2024
72ec3a5
added assignment ideas
Luc1nd4 Mar 20, 2024
cbfdce3
updated readme
Luc1nd4 May 20, 2024
2ce6dda
added project
Luc1nd4 May 20, 2024
14ca763
added project
Luc1nd4 May 20, 2024
7862812
added project
Luc1nd4 May 20, 2024
69dc246
updated documentation and program
Luc1nd4 May 20, 2024
53f9888
updated documentation and program
Luc1nd4 May 20, 2024
78027e3
updated documentation and program
Luc1nd4 May 20, 2024
5c53778
updated documentation and program
Luc1nd4 May 20, 2024
7a4ebec
updated documentation and program
Luc1nd4 May 20, 2024
ccb5ecc
updated documentation and program
Luc1nd4 May 20, 2024
6f2df37
updated documentation and program
Luc1nd4 May 20, 2024
a28dc3c
updated documentation and program
Luc1nd4 May 20, 2024
8c54fdf
updated documentation and program
Luc1nd4 May 20, 2024
28e105a
updated documentation and program
Luc1nd4 May 20, 2024
e3e2986
updated documentation and program
Luc1nd4 May 20, 2024
1fe02eb
updated documentation and program
Luc1nd4 May 20, 2024
6804ae7
updated documentation and program
Luc1nd4 May 20, 2024
0b857f9
updated documentation and program
Luc1nd4 May 20, 2024
e91fa36
updated documentation and program
Luc1nd4 May 20, 2024
caafb02
attempted implementation of textures
Luc1nd4 May 20, 2024
faa978d
attempted implementation of textures
Luc1nd4 May 20, 2024
3ca9e68
attempted implementation of textures
Luc1nd4 May 21, 2024
3717434
attempted implementation of textures
Luc1nd4 May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated documentation and program
Luc1nd4 committed May 20, 2024
commit 69dc246776f2779e0ad9880ec18171a05aa0dbc9
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
# Fish Flocking Simulation using Reynolds Flocking Algorithm

My initial idea was to create
My initial idea was to create a fish flocking sim to immitate a fish shoal as close to the real world as I could, I also wish to implement a UI that allows adjustment of different paramaters that updates the movement of the fish in real time.
This would involve:
-A flock class
-A boid class
-Importing and objs, and having them follow the fish movement and rotations
-A UI which allows for dynamic interaction of fish movement
-The fish to move in a circular motion.

### Iterations and Development
---
I used Jon Macey's Particle system initially from the template 'BlankNGL', as this already had a great framework for handling large numbers of rendered objects such as particles, it also had a good framework for being able to interact with the scene using mouse controls using QMouseEvents.

After intitial research and planning, I decided that I needed the following objects & functions:
***Flock class:***
---
- Flock - List of boids in scene
- boid size
- A function to initialise the boids
- update function, for putting all 3 functions together and adding them to the velocity of each boid in the flock
- Some kind of function to calculate a vector to make the boids move in a circular motion.
- Separation, alignment and cohesion functions - return a vector to add to the velocity for each boid in scene
- render function - to render the objs for each boids

***Boid class***
---
- position - vector
- velocity - vector
- accelaration - vector
- Max speed of boid
- Max force of the boid

After following this tutorial on how to write these three flocking functions: https://youtu.be/mhjuuHl6qHM?si=eL_OH50BlWzTPAW2 , refactoring the NGL particle system, and adjusting the needed parameters, I managed to get this:
/home/s5524683/Desktop/CFGAA/cfgaa24programingassignment-Luc1nd4/Videos



### Research & Annotated bibliography
---

Intended outcome:
https://www.youtube.com/watch?v=15B8qN9dre4
- I wanted the fish to all circle eachother and be able to travel at different speeds.

Initial algorithms & tutorial:
https://youtu.be/mhjuuHl6qHM?si=eL_OH50BlWzTPAW2
Helped understand the three algorithms needed for a believable flocking system: Separation, alignment, and cohesion.
Although in javascript, this was especially useful to follow upon initial implementation of these three algorithms. I implemented these functions in my Flock class, so that it could loop through all boids in the flock to follow the intended movement in the update() function.
https://www.youtube.com/watch?v=bqtqltqcQhw
-First video I watched when trying to implement this program.

https://github.com/DrAshBooth/Boids/blob/master/boid.cpp
- Helped me apply the vector math and logic needed in these three algorithms in c++

Fish model used:
https://www.cgtrader.com/free-3d-models/animals/fish/common-carp-fish

### Build

Binary file added Videos/Iteration1.mkv
Binary file not shown.
Binary file added Videos/Iteration1.mp4
Binary file not shown.
Binary file added Videos/Iteration2.mp4
Binary file not shown.
Binary file added Videos/Iteration3.mp4
Binary file not shown.
Binary file added Videos/Iteration4.mp4
Binary file not shown.