Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DrA1ex committed Sep 30, 2023
1 parent 4f940e6 commit ba0f4eb
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ Yet another physics engine implementation.

## Showcase
### Snow
<img width="1498" alt="image" src="https://user-images.githubusercontent.com/1194059/206975949-c1e56c28-7e7f-47d7-b970-ab6d9d81af5d.png">
<img width="1400" alt="image" src="https://user-images.githubusercontent.com/1194059/206975949-c1e56c28-7e7f-47d7-b970-ab6d9d81af5d.png">

This demo project showcases the capabilities of a physics engine and built-in canvas renderer, with a focus on real-time snow physics. Additionally, a snowdrift feature has been implemented, which grows as snow particles accumulate on it, and a smoke particle system, which [interacts](https://dra1ex.github.io/physics-js/examples/particles) with the environment in a realistic way.

The terrain is procedurally generated, ensuring that each scene is unique. To further enhance the visual experience, there are six different themes available for each time of day. By utilizing geoposition access, the theme can be automatically synchronized with the local sun position, creating an immersive and dynamic experience.

The demo has been designed to be used as a live desktop wallpaper or screensaver, and is compatible with popular customization tools such as Wallpaper Engine and Plash. Configuration options are available to further customize the experience to your liking.

While the demo can run without user interactions, users can click or touch the screen to play with the snowdrift and make it grow. The snow and smoke particles use an impulse-based physics solver, resulting in accurate physical interactions with the environment.

### Features:
1. Real-time snow physics.
Expand Down Expand Up @@ -36,10 +44,26 @@ Yet another physics engine implementation.
- Debug mode: [link](https://dra1ex.github.io/physics-js/examples/snow/?stats=1&debug=1)
- Tree debug mode: [link](https://dra1ex.github.io/physics-js/examples/snow/?stats=1&debug=1&debug_tree=1&debug_velocity=0&debug_boundary=1&smoke_interval=500&snow_emit=200)

### Gravity
<img width="1400" alt="image" src="https://github.com/DrA1ex/physics-js/assets/1194059/39f0701b-d09f-4e5b-a40d-32b508ba01e1">


This is a gravity N-Body simulation, similar to my other project available on [GitHub](https://github.com/DrA1ex/JS_ParticleSystem). However, this simulation includes collision physics using a pretty accurate impulse-based physics solver.

The simulation models the interactions between multiple bodies in a gravitational field. Each body has its own position, velocity, and mass. The simulation calculates the gravitational forces between the bodies based on their relative positions and masses, and uses this information to update their velocities and positions over time.
In addition to the gravitational forces, this simulation also models collisions between bodies. When two bodies collide, their velocities are adjusted based on the laws of conservation of momentum and energy. This ensures that the simulation is physically accurate and can generate realistic outcomes.

The simulation can run in real-time as it utilizes WebGL for image rendering, resulting in an image that closely resembles a lava lamp. It can be used as a screensaver or wallpaper. However, if you desire a more complex simulation, you can modify the simulation settings (the button is located in the lower-right corner) and increase the particle count or make other parameter changes.

### Links:
- 300 particles: [link](https://dra1ex.github.io/physics-js/examples/gravity/)
- 1000 particles: [link](https://dra1ex.github.io/physics-js/examples/gravity/?count=1000&min_size=40&max_size=100&friction=0&restitution=0&gravity=110&w_scale=80)
- 5000 particles: [link](https://dra1ex.github.io/physics-js/examples/gravity/?count=5000&min_size=100&max_size=200&friction=0.1&restitution=0.85&gravity=80&min_distance=100&p_scale=15&w_scale=400&tree_cnt=16)
- Debug mode: [link](https://dra1ex.github.io/physics-js/examples/gravity/?count=100&min_size=10&max_size=20&p_scale=10&w_scale=20&debug=true&debug_boundary=false)

## Examples

- Particles (WebGL): [link](https://dra1ex.github.io/physics-js/examples/particles)
- Gravity (WebGL): [link](https://dra1ex.github.io/physics-js/examples/gravity)
- Ramp: [link](https://dra1ex.github.io/physics-js/examples/ramp)
- Friction: [link](https://dra1ex.github.io/physics-js/examples/friction)
- Tower: [link](https://dra1ex.github.io/physics-js/examples/tower)
Expand Down

0 comments on commit ba0f4eb

Please sign in to comment.