Particle applet

Wrote a little particle system and an applet that uses it at work while there was nothing else to do… ;D
It has no sense and no purpose and here it is: http://www.jpct.net/party

Yeah, I was thinking it would be nice to make a little side-area on JGF somewhere to show-off this little bitty applets people do that are either graphically impressive or showcase games-techniques (or even, in the case of Cas’s stuff, get a decent game into an applet!).

LOL - can you imagine just embedding them all into one page? Watch your browser + desktop slow to 1 FPS or less, and weep…

There are so many applets that are dodgy on the whole start/stop business that I’m not sure whether this could be done safely - and I’m not going to risk it if it can’t be done safely.

Perhaps a drop-down box for select an applet to start, using a screenshot as a guide to the user, and a button to start / stop it with some jiggery-pokery to force-stop the damn thing?

Unfortunately, off the top of my head, there’s no way to force stop an applet: Sun doesn’t allow you to invoke thread.stop from within an applet (stupid stupid stupid)?

(PS: to anyone who still thinks Sun’s excuse for deprecating thread-stop is valid: please explain how else to stop someone else’s applet ? This is what Thread.stop was made for…)

PS Nice applet, but looks like you hit one of the problems I had :wink: - your applet is flickering a bit. Double-check your update( Graphics ) methods ? Double-check your BG paint routine?

[quote]PS Nice applet, but looks like you hit one of the problems I had :wink: - your applet is flickering a bit. Double-check your update( Graphics ) methods ? Double-check your BG paint routine?
[/quote]
Should be fine…update and paint are doing nothing any more, the rendered image will be painted to the applet directly when it’s done. I assume you are watching it on a TFT? Due to the amount of tiny but fast moving particles, it looks a little bit like flickering on TFTs and fine on “normal” monitors. At least that’s what i noticed…

Yes :slight_smile:

Ah…I sort of believe you :P. But I’m not convinced that it could look like flickering without actually being it? Although I see what you mean about how it woulkd have to be very slight indeed in order to show up on TFT but not on phosphor delay CRTs.

In addition, assuming the colours were as uniform as they appeared to be?, I was noticing classic effects of flickering of small lights: they kept changing colour if looked at slightly indirectly (IIRC this hasn’t been fully explained by biologists yet, rather merely observed?, but a white light flashing at different frequeencies tricks the brain into thikning it saw red, green, blue, etc).

Interesting problem to have, either way :).

[quote]In addition, assuming the colours were as uniform as they appeared to be?
[/quote]
No, they are not. The particles are simply billboarded, textured polygons and the texture is not uniform. It consists of some small filled blue and white circles IIRC. Could be that the “flickering” comes from undersampling and/or rendering artifacts when rendering small polygons. It goes away when using the OpenGL renderer with trilinear filtering/mipmapping instead of the software one that the applet is using.

Ah, I bet that’s it then. Care to try making a version with uniform textures for comparison?

[quote]Care to try making a version with uniform textures for comparison?
[/quote]
I replaced the jar with a version that uses unicolored circles as textures (almost, apart from JPG compression artifacts at the borders).

Hmm. Seems to flicker in a different, more precise, way now - and I think that it’s just the fact that the motion is very un-smooth (jerky).

Particularly particles in the background, so to speak, seem to jump many pixels from frame to frame - off the top of my head, feels like circa 15 fps? whilst ones right in the foreground move noticeably more smoothly.

The jerky movement makes a pseudo-flickering effect because they’re so small (like jumping identical objects by huge distances, 200 pixels in a frame, makes them appear to flicker on and off). I think the colouring issues before were just exaggerating this…