I've spent the last four months working with LED cubes, and this instructable is my way of sharing some of the knowledge and techniques that I've built up over this time. If you have a cube of your own, this might help you make cooler graphics and animations for your cube. Don't have a cube? Tinker around in simulation with my new Processing library for LED cubes.

If you want a cube of your own, allow me to shamelessly point you towards our own open-source, color LED cube, which we just launched on kickstarter.

Whatever you do, if you make something awesome, share it in the comments!

Happy Hacking,


Step 1: Cube 101

Drawing in an LED cube is just like drawing on a 2D screen.

On a 2D screen, you have a grid of pixels, and to draw a graphic, you just tell a pixel at a certain (x,y) point to be a certain color.

In a cube, you have a 3D grid of VOlumetric piXELs, or voxels, and you tell a voxel at a certain (x,y,z) point to be a certain color. The drawing here shows you the co-ordinate system I use in these animations.

In all the examples here, I'm drawing in an 8x8x8 cube, but these same techniques will work in any resolution.

If you'd like to follow along and work on your own code, grab the Processing environment if you don't already have it, and install the L3D Cube Processing library. All of the code in this instructable is included as an example in the library, and it makes a great jumping-off point for developing animations of your own.

Finally, put on a Journey playlist and punch your ticket on that midnight train.

<p>Hi Alex, for step 3, can you give us initial values for radius and lineAngle? Also, can you clarify how you were able to get poseCube()? I was able to get all of the other variables/methods from L3D except for this one. I've gotten up to there and now I'm a little stuck (btw the code is really awesome :)).</p>
<p>Hey tehkingwong, I had the same problem initially,</p><p>you can look at the l3d library examples in processing under file-&gt;examples-&gt;libraries-&gt;l3d cube library</p><p>heres the complete code from this example, which worked for me.</p><blockquote>import L3D.*;<br>L3D cube;<br>float radius=3.5, lineAngle;<br>PVector center;<br><br>void setup()<br>{<br> size(500,500, P3D);<br> cube=new L3D(this);<br> // cube=new L3D(this, &quot;your@spark.email&quot;, &quot;your password&quot;, &quot;cube name&quot;);<br>}<br><br>void draw()<br>{<br> background(0);<br> cube.background(0);<br><br> for (float theta=0; theta&lt;2*PI; theta+=PI/3)<br> {<br> PVector start=new PVector(cube.center.x+radius*cos(theta), 0, cube.center.z+radius*sin(theta));<br> PVector end=new PVector(cube.center.x+radius*cos(theta+lineAngle), cube.side-1, cube.center.z+radius*sin(theta+lineAngle));<br> color col=cube.colorMap(theta%(2*PI), 0, 2*PI);<br> cube.line(start, end, col);<br> }<br> lineAngle+=.05;<br><br>}</blockquote>
<p>Oh man ! like a colorful floating wave!</p>
<p>awesome thanks for this!</p>
<p>Really you and your teammate have done nice piece of creative work.. I did 3x3x3 and 3x3x3 RGB LED cube a year back. I only back off for larger size because Soldering with standard RGB LEDs is time taking complex work. If any LED goes wrong, replacing it will be nightmare. Though I know about WS2812 LED and worked on it, but never thought about replacing RGB LEDs with WS2812. Looking to your work, now I am planing to again to make myself one. It will be a fun work to make something like this. Good Work Alex!! :)</p>
<p>Nice build...</p><p>I want to have it....</p>
<p>Very cool!</p><p>Thank you for sharing such great info too. Good luck with the kickstarter.</p>

About This Instructable




Bio: here: http://www.artiswrong.com But really, I'm just this guy. For up-to-the-minute, action-packed updates on my life (and occasional drawings of tapeworms getting ... More »
More by prank:How to Draw Sweet 3D Graphics for LED cubes Make rad solar panels in minutes with a sweet desktop laminator Pixie, the world's most intense desk lamp 
Add instructable to: