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?
Asked
Active
Viewed 7,866 times
8
-
1If you can figure a way to do it in any language, it can be done in Java. – Andrew Thompson Jun 12 '11 at 07:32
1 Answers
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:
- Particle Systems, by Daniel Shiffman.
- Particle Systems in Java, by Jerry Huxtable.
Related question on Stackoverflow:

Community
- 1
- 1

Vineet Reynolds
- 76,006
- 17
- 150
- 174
-
2Particle 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