I'd like to make something like a sand clock with javascript and I'd like to be pointed in the right direction. I have some questions, but first, the idea:
- There is a rectangle of defined size, this is my container.
- From the top of the screen, a 5px x 5px square shape will fall out of another container at a defined rate (each created one by one, not all at once).
- This 5x5 square shape will land in the box and bounce according to tuned physics.
- After it falls into the box, it will neatly organize itself into a stack, filling the container from left to right, bottom to top.
- The container will be leaky, and rate at which it leaks will be adjustable.
Now questions:
- Will I be falling into performance issues (macbook) by having around 200,000 5x5 squares on the screen at the same time? Or is that something a browser could likely handle?
- What is the best way to create the objects? I'm immediately thinking making each one of them a div is the WRONG way to go. What can I use to make these sort of particles?
- Are there libraries that will allow me to let them all blend together, but eventually self organize so that they fill the container neatly?
This is a personal development project and my first venture into physics animation using code, and I have no experience in creating particles and physics, so any recommendations would be so greatly appreciated!
TLDR: Looking for help in javascript with:
- Particle Creation
- Gravity Simulation
- Border occlusion between objects
- Self organization of particles (particles will line up nicely and not overlay each other)
- Controlled particle deletion
- General system limitations for a project like this with upwards of 500,000 individual particles
Epic visual tool
Epson 5030UB 2D/3D 1080p 3LCD Projector
No comments:
Post a Comment