Skip to content

2D visualisation of the step-by-step process of various Convex Hull algorithms. Made with C++, using Raysan5's Raylib for rendering, and RayGUI for the GUI

License

Notifications You must be signed in to change notification settings

AlexanderNeo427/Convex-Hull-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convex Hull Visualizer

2D visualization of the step-by-step process of various Convex Hull algorithms. Made with C++, using Raysan5's Raylib for rendering, and RayGUI (an immediate mode GUI module meant to work with Raylib) for the GUI. Demo video can be found here

Implementation

  • The concrete implementations of many of these algorithms usually involve quite a few nested loops, and I don't want to dirty up my update loop by placing a render() call inside it.
  • Thus, the approach taken was to, within the algorithm computing the convex hull, push an instance of IAnimFrame2D (which contains information about what to draw) for each step of the convex hull, into a queue.
  • During one update iteration, all the steps of the convex hull are computed and the cached
  • Then, for each render() call, you can unload the IAnimFrame2D's one-by-one from the queue to display

Extra

  • At the time of writing, there are only 2 algorithms concretely implemented (Jarvis March & Graham Scan).
  • However, the system is extensible. You only have to implement IConvexHull2D, as well as raise an event to set the current algorithm to be used.
  • Using state pattern for the control flow of the application (Idle, Generating Points, Animating....)

About

2D visualisation of the step-by-step process of various Convex Hull algorithms. Made with C++, using Raysan5's Raylib for rendering, and RayGUI for the GUI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published