If you give your email address, we'll email you a link so you can come back to your animation later and edit it.
We may also use it to contact you about any future Illuminatrix projects - but we promise we won't spam or abuse it!
If you give your email address, we'll email you a link so you can come back to your animation later and edit it.
We may also use it to contact you about any future Illuminatrix projects - but we promise we won't spam or abuse it!
The code area allows you to specify JavaScript to execute upon the page to generate the frames of the animation.
Use at your own risk!This is by no means well tested, and you can easily break the site with the code you enter here or lock up your browser, but fear not! We don't use the code anywhere on the site, so if everything gets broken, just refresh your page and start over.
We've included a couple of different libraries into the page for you to use, first off YUI3 is available. This has all sorts of stuff in it, but is mostly for DOM manipulation and so on so probably won't be too useful for you.
More usefully however we've added the Sylvester JavaScript library, this has loads of really useful stuff for doing math with Vectors and Matrices. Just the sort of thing you need to do 3d effects.
We've added a system so you can use the editor to generate sprites which you can then reuse in code. This is a really powerful feature and should we hope lead to a lot more keyframe based animations.
To use this feature, simply draw your keyframe sprites as you would any other animation. All sprites generated with this method are assumed to be 16 x 16 pixels in size. Any pixel set to a colour value of {h:0,s:0,l:0} is assumed to be transparent and will not be drawn (this is the default colour of all pixels in new frames).
After your sprite is complete, you can convert it to a JavaScript array that you can use in your coding by putting the following code in the code area:
this.convertToSprites();
Hit 'Generate Frames' and the code will output the sprites as arrays and the colours used in your sprites as a palette array in the code area.
You can now paint these arrays in the display using the 'paintPaletteSprite' function, passing into it the sprite and palette variables the code generated for you.
This code, renders a heart shaped sprite in red to a single frame.
var heart = [ 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0 ]; var frame = this.createFrame(); // paint the sprite at position 3,3 in full red this.paintSprite(frame, heart, 6, 7, 3, 3, 0, 1.0, 0.5);
This code example copies the previous frame, fades it, then renders randomly renders a new sprite heart to the frame. After 90 frames it fades to black.
var heart = [
0, 1, 1, 0, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 0,
0, 0, 1, 1, 1, 0, 0,
0, 0, 0, 1, 0, 0, 0
];
this.clearFrames();
for (var f = 0; f < 90; f++) {
var frame = null;
if (this.frames.length > 0) {
frame = this.copyFrame(this.frames.length-1);
this.subtract(frame,'l',0.05);
} else {
frame = this.createFrame();
}
if (Math.random() > 0.7) {
var x = Math.round(Math.random()*18-3);
var y = Math.round(Math.random()*18-3);
this.paintSprite(frame, heart, 7,6, x,y, 0, 1.0, 0.5);
}
this.addFrame(frame);
}
this.fadeToBlack(30);
This example produces the same result as the Many Hearts example but demonstrates the use of palette based sprites.
var palette = [{h:0,s:0,l:0},{h:0,s:1.0,l:0.5}];
var sprite = [
0, 1, 1, 0, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 0,
0, 0, 1, 1, 1, 0, 0,
0, 0, 0, 1, 0, 0, 0
];
this.clearFrames();
for (var f = 0; f < 90; f++) {
var frame = null;
if (this.frames.length > 0) {
frame = this.copyFrame(this.frames.length-1);
this.subtract(frame,'l',0.05);
} else {
frame = this.createFrame();
}
if (Math.random() > 0.7) {
var x = Math.round(Math.random()*18-3);
var y = Math.round(Math.random()*18-3);
this.paintPaletteSprite(frame, sprite, 7,6, x,y, palette);
}
this.addFrame(frame);
}
this.fadeToBlack(30);
This code snippet shows how to use the frameGenerator to asynchronously generate your frames, allowing you to do very cpu intensive tasks without hanging your browser.
// setup local variables
var myHue = 0;
this.clearFrames();
this.frameGenerator.generateFrame = function() {
var frame = this.createFrame();
// your frame generating code here as normal
this.fillFrameColor(frame, myHue, 1.0, 0.5);
this.addFrame(frame);
};
// generate 100 frames
this.frameGenerator.start(100,this);
Simply select a colour from the left, click on the LEDs in the middle to set the colour of them and draw your frame.
To add a new frame click the 'Insert' link at the bottom, each new frame will copy the previous one.
To delete a frame, first select it by clicking in the timeline below, then click the 'Delete' link in the bottom left.
Set the delay (in ms) between each frame using the slider above. This won't be guaranteed, but we'll attempt to get as close as we can to this delay between each frame.
For the really advanced, click the 'Show the code area' link in the top left to allow you to write JavaScript to create your frames.
Thanks for your animation.
Your ID is: 000000001Remember your ID, and come check it out on the playa at 5:30 and Baghdad
Make another animation!Something went wrong, and the server failed to save your animation!
Woops!We're sorry about this....try saving again
Please wait while your frames are computed...