Yet another physics engine implementation.
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 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.
- Real-time snow physics.
- Snowdrift that grows as snow falls on it.
- Real-time smoke particle system with physics interactions (e.g., repelled by a snowdrift).
- Procedurally generated terrain.
- Six different themes for each time of day.
- Theme synchronization corresponding to the local sun position (requires geoposition access).
- Can be used as a desktop live wallpaper (compatible with Wallpaper Engine, Plash, etc.).
- Configurable options.
- Theme synchronization mode: link
- Custom geoposition with sun sync: link
- Periodic theme change mode: continuosly / every 5 minutes / every hour
- Different graphics presets: Microwave / Low / Medium / High / Ultra
- Debug mode: link
- Tree debug mode: link
![image](https://private-user-images.githubusercontent.com/1194059/271772713-39f0701b-d09f-4e5b-a40d-32b508ba01e1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNTU1MzMsIm5iZiI6MTcyNjE1NTIzMywicGF0aCI6Ii8xMTk0MDU5LzI3MTc3MjcxMy0zOWYwNzAxYi1kMDlmLTRlNWItYTQwZC0zMmI1MDhiYTAxZTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MTJUMTUzMzUzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjliMWZlNzVmMzFhZmMxZDY1YzBkZmE2ZjJkZDk2Njk0YWMxZWNiODYzNjdmZjE0ZmI0ZDlhYWJmNGQ3ZjBmYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Rsps5ZRXZBtcgf2Iq9HSNLTrgmPt1IH9cUoGIQBQ2Ew)
This is a gravity N-Body simulation, similar to my other project available on GitHub. 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.