Giter Club home page Giter Club logo

ballcollision's Introduction

Ball Collision

This project simulates a 3D elastic collision between balls inside a closed box conserving the kinetic energy.

BallCollision

Getting Started

These instructions will get you a copy of the project and it's dependencies. As well as how to run it on your local system.

Prerequisites

You will need to install:

On Linux:

sudo apt install python3-pip (If You don't have pip installed)

pip3 install pyopengl

sudo apt-get install freeglut3-dev

On Windows:

Download PyOpenGL Windows

And then:

pip install path-to-the-whl-file-that-you-downloaded

Installing

Clone the repository:

git clone https://github.com/MatheusBurda/BallCollision.git

Running the tests

Linux:

pyhton3 BallCollision.py

Windows:

py BallCollision.py

Optional arguments:

usage: BallCollision.py [-h] [--width WIDTH] [--height HEIGHT]
                        [-n NUM_BALLS] [-r RADIUS] [-v MAX_VELOCITY]
                        [--no-color] [-s SIZE]

optional arguments:
  -h, --help            show this help message and exit
  --width WIDTH         screen width. Defaults to 800
  --height HEIGHT       screen height. Defaults to 600
  -n NUM_BALLS, --num-balls NUM_BALLS
                        amount of balls used in the simulation. Defaults to 15
  -r RADIUS, --radius RADIUS
                        radius of balls. Defaults to 0.45
  -v MAX_VELOCITY, --max-velocity MAX_VELOCITY
                        max velocity allowed. Defaults to 0.005
  --no-color            toggle colored balls off
  -s SIZE, --size SIZE  size of the cube that contains the balls. Defaults to 4

A window should pop up with the simulation.

To stop the simulation just close the window.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

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.