Recent top five:
Java.next -- Four languages that represent the future of Java
Blogger Stuart Halloway has begun a series of posts on trends that point to the future of the Java platform. In his first
post, he compares Clojure, Groovy, JRuby, and Scala -- four wildly different languages that nonetheless all play together
in the JRE. Find out what unites these languages and what they can tell us about the future of Java-based development ...
| Enterprise AJAX - Transcend the Hype |
| Memory Analysis in Eclipse |
| Oracle Compatibility Developer's Guide |
| Memory Analysis in Eclipse |
Computer graphics (CG) is important to the games we play, the movies we watch, the design of our vehicles, and more. CG uses traditional polygon-based techniques to model and render classical geometry (cones, spheres, cubes, etc.). In contrast, the geometry of natural phenomena—such as fire and flowing water—needs a different modeling, rendering, and animation technique: particle systems.
After introducing you to the particle system concept and presenting particle systems in a historical context, this Java Fun and Games installment takes you on a tour of Java-based software that I created to build and play with particle systems. The article then reveals a demo applet that uses this software to simulate explosion rings, fireworks explosions, and vapor trails.
A particle system is a CG technique that combines modeling, rendering, and animation to simulate fuzzy phenomena (also known as fuzzy objects); examples are various kinds of explosions, flowing water, clouds, fire, meteor trails, snow, sparks, fog, and falling leaves. These phenomena are called fuzzy because, due to the absence of straight edges, they appear blurred when rendered: they are composed of particles.
Particle systems manipulate collections of particles. Each particle has various attributes that affect the particle's behavior, along with where and how (as a point composed of one or more pixels, a line, an image, and so on) the particle is rendered. Common attributes include position, velocity (speed and direction), color, lifetime, age, shape, size, and transparency. Most of these attributes vary their values during the particle's existence:
Particle systems have been in use for several decades. Perhaps their earliest use dates back to 1961-1962. According to "Welcome to PONG-Story," in 1961, three MIT students created a video game called Spacewar for the PDP-1 minicomputer (released by Digital Equipment Corporation in November 1960). This game featured a particle system to simulate explosions.
Spacewar involves a pair of spaceships battling around a star whose gravity pulls them in. While trying to avoid the star, these spaceships fire torpedoes at each other. As Figure 1 reveals, the particle system rips apart a spaceship when the spaceship is hit by a torpedo.

Figure 1. The lower-right spaceship's breakup is generated by a particle system
The Spacewar particle system also generates explosions whenever both spaceships collide. Despite a low resolution and the absence of color, Figure 2 indicates a degree of realism that the particle system achieves when simulating explosions.

Figure 2. The particle system manages two explosions when both spaceships collide
| Note |
|---|
If you would like to play the original Spacewar game (which is in the public domain), point your Web browser to the Spacewar instructions page and follow the instructions. After you download the Perl and Java source files, you will need to install a copy of Perl on
your system (if you don't already have Perl installed) and execute the following commands to create spacewar.bin:
After you create |
Subsequent to Spacewar, particle systems were used in other games (such as Asteroids). But their potential was not realized until 1983. In that year, Lucasfilm's William T. Reeves published his paper "Particle Systems: A Technique for Modeling a Class of Fuzzy Objects." This paper formalized the particle system concept. It was well received because it described the particle system that generated the Genesis Effect's planetary wall of fire in the movie Star Trek II: The Wrath of Kahn. If you have an account with the Association for Computing Machinery, you can read Reeves's paper, a link to which appears in Resources.
Particle system software lets you simulate fuzzy phenomena by supporting the modeling, rendering, and animation of particles.
My Java-based particle system software provides the PS class to support modeling and facilitate animation. It also provides the Display class to support rendering. I first discuss Display because PS depends on this class.
The Display class is a java.awt.Canvas component that renders particles. It renders particles as individual pixels, although there is no reason why Display could not render them as groups of pixels, images, and so on.
| Subject | Replies |
Last post
|
|
By JavaWorld |
0 |
07/23/07 06:25 AM
by Anonymous |