/snowstorm

Beautiful physics based snow simulation in pure Java 7 with AWT. No dependencies just download and run!

Primary LanguageJavaMIT LicenseMIT

SnowStorm

YouTube video

Beautiful physics based snow simulation in pure Java 7 with AWT. No dependencies just download and run!

The simulation features a very simple 3D physics and rendering engine. All particles experience:

  • Gravity
  • Air drag
  • Variable wind speed in different sections

The wind effect can create vortexes that carry particles around in a very realistic manner.

This also supports 3D TVs (side by side) for a fully immersive 3D snow experience.

Disclaimer: This is a just-for-fun and possibly educational project created from scratch in an afternoon. So no unit test, no seriousness, no attempt to make it 100% physically accurate. Just enjoy the snowflakes, they are beautiful!

Download

Click to download regular version

Click to download 3D version (will only work on 3D TVs and projectors)

If you have Java installed, double click the downloaded file. No additional installation required.

Works on all operating systems that support Java Runtime Environment (JRE): Linux, OS X, Windows

If you chose the 3D version, SnowStorm will launch full screen on your external display. Make sure that this displays supports 3D content. For example, you can connect your PC to a 3D capable TV or projector. The 3D output mode is side-by-side, left-right.

Compiling

This is a plain IntelliJ IDEA project. Since the project doesn't have any dependencies you can just run it!

Tweaks

All Java constants. Adjust in source and re-compile. No interactive controls implemented.

  • Framerate - Default is 60 fps. Could be adjusted in info.martinmarinov.snowstorm.physics.Driver. I recommend setting it to 30 fps if you have any performance issues.
  • Number of snowflakes - Default is 1000. Could be adjusted in info.martinmarinov.snowstorm.Main. Reduce if you have performance issues.
  • A lot of tweaks regarding snowflake size, distribution and initial speed in info.martinmarinov.snowstorm.physics.SceneGenerator
  • Tweaks regarding speed of gravity, air resistance and wind direction in all classes under package info.martinmarinov.snowstorm.forces

Background and licensing

The code is released under the MIT license without any warranty. Please read the LICENSE file for more information.

The background image is royalty free provided by PIXELS.