Stackable Graph Cubes
Posted by Peter | Filed under Uncategorized
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
- stackable_graph_cube_1.2.lsl (highlighted) — changed the event handling to respond to touches rather than moving (idea courtesy of Jeremy Kemp… ta!), and re-enabled physics by default, as it works better now. You can now also simply touch a cube to align it, in case lag is a problem
- stackable_graph_cube_1.1.lsl (highlighted) — physics disabled by default, cubes snap in all dimensions, and rotations are (hopefully) fixed
- stackable_graph_cube_1.0.lsl (highlighted) — allows (buggy) physics, works with vertical stacking only, and has rotation problems
Video
Usage
To use it, put the above script into a 0.5×0.5×0.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!
Credits
- Shamblesguru Voom (SL name) — had the original idea which led me to develop this
- Jesse Barnett (SL name) — developed a variant called Sandbox Blox, inspired by this mini-project
5 Responses to “Stackable Graph Cubes”
Leave a Reply
You must be logged in to post a comment.



November 30th, 2008 at 12:57 am
Nice one… sounds funky.
You should get some screenshots of this!
Could do a variety of games with this - like put textures on an array of cubes and challenge people to re-assemble an image
I might try that one out, actually…
what else could we do with this?
December 1st, 2008 at 1:50 am
It’s great Peter! I can see many uses for this in the ESL world.
Example - crossword puzzles, word searches, building words - looks great!
December 1st, 2008 at 6:01 am
Feedback & Thanks.
My initial request was for a cube with these stacking properties for a 3D Graphing Tool in Second Life ….. which can be found in a “Data Visualisation” display I’m putting together in International Schools Island.
In the entrance of the Technology Tower
SLURL http://tinyurl.com/2o44dw
…. and, Peter, really appreciate the work you have done on this … brilliant.
Feedback on v1.1 …. if set to ‘anyone move’ and ‘not physical’ then I think the possibility of users dropping the cubes into the ground and losing them is quite high …. pictures of a ‘cubes graveyard’ are flashing through my mind.
One solution for me to this is organisational (I don’t know if a scripting solution) … advise users(teachers/students) to work on a SkyPlatform … then can be cleaned up after a lesson.
(Chris)
December 1st, 2008 at 11:05 am
Yes indeed… the cubes can end up falling through the ground, so you can enable physics by changing the “USE_PHYSICS” option in the script to TRUE. Unfortunately they can then end up getting pushed through the ground when they try to align themselves, so there’s no perfect solution.
Previously, the physics worked rather poorly with this, but the CLOZE quiz which Jeremy Kemp has been working on manages the temporary physics better, so I’ll maybe use the same idea as he had.
December 2nd, 2008 at 5:54 am
Every morning over the past few days I wake up and have found an improved version of the cubes script … this is even better ….. (my time zone is Thailand)
All I can continue to say is ‘brilliant’