Code Monkey home page Code Monkey logo

convex-hull-visualizer's Introduction

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....)

convex-hull-visualizer's People

Contributors

alexanderneo427 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.