Home Software Second Life / OpenSim Stackable Graph Cubes

Stackable Graph Cubes

Written by Peter R. Bloomfield | Wednesday, 03 December 2008 03:35

A free and open source LSL script (GPLv3) to help you build simple cube-based structures such as graphs very quickly and neatly.

 

Sorry, I can no longer maintain a presence on the SL Marketplace to distribute items directly in-world.

However, please feel free to download the source code for this tool below.

In response to a request on the SLOODLE forums, I decided to try making a script to let you reliably drag-move cubes around, such that they would 'snap' together, so you can build graphs and other blocky shapes. It was a good challenge, and so I've created a script to do the job.

Download
Video

Usage

To use it, put the above script into a 0.5x0.5x0.5 cube in Second Life. Make sure the cube can be moved by anybody, and that's in. Clone as many as you need, and use Ctrl+Drag to move them around -- when a cube gets close to another, it should 'snap' to it, matching its orientation and lining up neatly.

Notes

Note: cubes will only snap to other cubes of the same name. You can use that to create independent stacks of cubes which won't interfere with each other.

Idea: if you want to create an immovable base, then disable the script in one of your cubes (but do not delete the script... just clear the "Running" checkbox). Other cubes will snap to that base, but the base won't snap to other ones. It's a good idea to change its colour to signify the difference, and to disable drag-moving on it.

Known Issues
  • In version 1.0 and 1.1, the cubes don't always snap quickly, if ever... this seems to be a particular problem at low framerates
  • Cubes can end up snapping into the same position as another... some kind of avoidance algorithm would be useful!