Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawing smoke effects with java

Tags:

java

java-2d

Is there any way to draw a smoke effect in java (by using Java2D API). I want to achieve this: when a user provides the color for the smoke, the program automatically draws a smoke effect with that color. How could I do this?

like image 376
Mad Avatar asked Jun 12 '11 06:06

Mad


1 Answers

The terminology used in computer graphics is particle systems, and not smoke effect. After all, you can model smoke by treating it as a collection of several particles.

There are quite a few tutorials that discuss building particle systems in Java. Both of the links listed below have source code:

  • Particle Systems, by Daniel Shiffman.
  • Particle Systems in Java, by Jerry Huxtable.

Related question on Stackoverflow:

  1. 2D smoke/fire/mist algorithm
like image 158
Vineet Reynolds Avatar answered Nov 03 '22 14:11

Vineet Reynolds