GithubHelp home page GithubHelp logo

kustomzone / 3d-spatial-partitioning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nickyvanurk/3d-spatial-partitioning

0.0 1.0 0.0 1.11 MB

3D Boids implementation to demonstrate Spatial Partitioning.

Home Page: http://nickyvanurk.com/boids-octree-simulation/

License: MIT License

HTML 18.28% JavaScript 81.72%

3d-spatial-partitioning's Introduction

3D Spatial Partitioning

A 3D Boids implementation to demonstrate Spatial Partitioning implemented with an Octree.

Motivation

As I was programming my 3D browser shooter I was particularly unhappy the way I handle bullet / ship collisions. So I started looking for a better solution, say hello to Spatial Partitioning! Instead of checking every bullet against every ship (O(n^2)) you can instead split up the world in partitions with the help of an octree. Every node in this tree represents a 3D space and each space allows a maximum number of entities. If the number of entities exceed the maximum, it splits the space into 8 smaller ones. It keeps doing this recursively. Now, for every bullet you can query the tree for other ships in the same space (node) instead of checking EVERY ship in the world. This makes this new method way more efficient (O(log n)) when handling a lot of entities.

License

This project is licensed under the MIT License.

3d-spatial-partitioning's People

Contributors

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