FractalNet
Home Software Music Other
Overview   Overview
Guitar Chord Explorer   GCE
Marble Challenge   Marble Challenge
ASCIIroids   ASCIIroids
Particle System Designer   PSD (Second Life)
Gravity Bubbles   Gravity Bubbles
FractalNet   FractalNet
EcoSim   EcoSim
Cosmic Dust   Cosmic Dust
LandMesh   LandMesh
Imagencrypter   Imagencrypter
Foxy Detector   Foxy Detector
MacDiff   MacDiff
Asteroid Belt   Asteroid Belt
Matrix Attack   Matrix Attack
Solar Swarm   Solar Swarm
Mac OS X Terminal guide   OS X Terminal
Tools   Tools
Names :-)   Names :-)
Particle System Designer
(Second Life)
Free!

Particle System Designer

My avatar standing next to my Particle System Designer in Second Life

For a few weeks at the beginning of 2007, I was a regular participant in the virtual world of Second Life.  While I was there, I learnt the basics of LSL, the scripting language used to control and interact with objects in Second Life.

Amongst other features of the virtual world, an object can be given a particle system to create animated visual effects that look like smoke, steam, dust, explosions, flames, sparks, fountains, lasers, and many other things.  These particle systems are quite difficult to design unassisted (they are created with a rather complex llParticleSystem() function call), so I decided to build myself a virtual machine to provide assistance.

My Particle System Designer (PSD) consists of around 2,400 lines of LSL code, 49 prims (primitive construction objects, such as spheres and cylinders) and some high-resolution textures (created in Adobe Photoshop and uploaded into Second Life).  It’s operated by “touching” the buttons on the front of the machine, and typing in numeric values when necessary.  The different parameters of the particle system are grouped into five categories for clarity (pattern, appearance, creation, behaviour and target), and the buttons change colour to indicate which parameters are active, inactive and selected.

I created a few demonstration particle systems which are included with the PSD, and are activated by touching the “LOAD DEMO” button:

Arch Fusion
Arch Fusion
Magnetic Photons Star Cluster
Magnetic Photons Star Cluster
Twinkling Sphere
Twinkling Sphere  

Once a user has designed a particle system, touching the “GENERATE” button will output the necessary LSL code, which the user can copy & paste to use in their own objects.  Comprehensive help is available by touching the “HELP” button.

As well as being able to adjust every parameter of the particle system, the PSD also features a rotating arm, which is activated by touching the “ROTATE” button.  This is useful for designing particle systems which leave a trail of particles behind as the emitting object moves through space.  The screenshot below illustrates the rotating arm in motion, and the particles are being attracted to the sphere on the opposite pole (this has been selected as the “target” object):

Rotation and target
Magnetic Photons demo, with rotation and target

Note: I don’t use my real name within Second Life, which is why you’ll see my avatar’s name on the PSD instead.


Video

This demo video shows the PSD in action within Second Life.  It shows the built-in demo particle systems, and then shows how to change the various parameters (including Pattern, Angle Begin, Angle End, Burst Part Count, Start Scale, Follow Velocity, Burst Radius, Target Pos, Interp Color and Part Max Age) to design your own particle system.

Watch this video on Vimeo  →


Script design

The following diagram illustrates how the various LSL scripts in the machine interact with each other:

Particle System Designer diagram

Drawn using OmniGraffle, a very cool program for drawing diagrams :-)

The scripts communicate using llMessageLinked(), and each script and prim has a unique ID number to identify it.  To pass particle system data between scripts, I modified this example list conversion code.

Feedback is provided to the user via instant messages (IMs) sent using llInstantMessage().  Normally, only one message can be sent every 2 seconds (this is an LSL restriction), but by having 8 separate IM scripts controlled by an IM manager, the overall delay time between IMs can be reduced by a factor of 8 (ie. 0.25 seconds between IMs).


Nearby Avatar Detector

Nearby Avatar DetectorAnother of my Second Life machines is my Nearby Avatar Detector (NAD) – a small wooden “pebble” containing a short LSL script, which can be attached to a user’s HUD.  Touching the NAD will cause it to scan the local area for other people (avatars), and list them in order of distance away from the user (closest first).  In addition, it will automatically report the nearest person every 2 minutes.

The screenshot below shows a sample output produced when the NAD is touched:

Nearby Avatar Detector output

The NAD uses llSensor() to scan for avatars within a radius of 96m (the maximum radius possible).  llDetectedName() and llDetectedPos() are then used to determine the name and relative position of each detected avatar.  llGetRot() is used to calculate the direction of each avatar relative to the user (for example, 16° right, or 34° left).  llGetAgentInfo() obtains more information about each avatar’s state, including: Away, Busy, Fly, In air, Crouch, Sit, Walk, Always run, Typing, Mouselook, On object, Atts (attachments) and LSL atts (scripted attachments).



Since I no longer enter Second Life very often, and I wouldn’t expect to make much real-world profit from my PSD and NAD, I’m making them freely available to all Second Life users.  However, donations are always very gratefully received!  If you would like a copy of either machine, please contact me, and I’ll meet you inside Second Life!


Automatic country lookup for comments powered by hostip.info
Comments

No comments yet.  Be the first to add a comment!


Add a comment

Contact me  –  Page last updated on 9th August 2008  –  Website hosted by 5quidhost (highly recommended!)
Michael Hogg