8

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?

Vineet Reynolds
  • 76,006
  • 17
  • 150
  • 174
Mad
  • 81
  • 1
  • 2

1 Answers1

9

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:

Related question on Stackoverflow:

  1. 2D smoke/fire/mist algorithm
Community
  • 1
  • 1
Vineet Reynolds
  • 76,006
  • 17
  • 150
  • 174
  • 2
    Particle systems is only one way to create a smoke effect, which is very good for animations. For static images, there are other ways, like fractal clouds. It really depends on what do you want to achieve. – lbalazscs Feb 01 '13 at 10:24