A simple pattern using HTML5 canvas. Here’s the code:
<script>
window.onload = function() {
var canvas = document.getElementById(‘myCanvas’);
var context = canvas.getContext(‘2d’);
context.translate(canvas.width/2, canvas.height/2);
context.beginPath();
for(var i = 0; i < 50; i++) {
context.lineTo(canvas.width/2, canvas.height/2);
context.lineTo(0, 0);
context.rotate(Math.PI * 2 * i-1);
}
context.strokeStyle = “#666”;
context.lineWidth = 2;
context.stroke();
context.beginPath();
for (var i = 0; i < 150; i+=5) {
context.arc(0, 0, 20+i, 0, 2 * Math.PI);
}
context.lineWidth = 2;
context.strokeStyle = “rgba(255, 170, 0, 0.5)”;
//context.fillStyle = “rgba(255, 100, 0, 0.5)”;
//context.fill();
context.stroke();
context.closePath();
}
</script>
![/*
Created by E. Reyes. Paris, Apr, 2012
Rigth-click = adds node
Drag node to rearrange
Perhaps it’s useful to teach how networks are created.
Based on the exercice 2, p 58 by K. Terzidis
*/
float [] px = new float[0];
float [] py = new float[0];
void setup() {
size(600, 400);
smooth();
}
void draw() {
background(230);
stroke(250, 150, 0, 150);
beginShape();
for (int i = 1; i < px.length; i++) {
for (int j = 0; j < px.length-1; j++) {
vertex(px[i], py[i]);
vertex(px[j], py[j]);
}
}
endShape();
for (int i = 0; i < px.length; i++) {
stroke(125);
fill(200);
ellipse(px[i], py[i], 10, 10);
}
}
void mousePressed() {
if (mouseButton == RIGHT) {
px = append(px, mouseX);
py = append(py, mouseY);
}
}
void mouseDragged() {
for (int i = 0; i < px.length; i++) {
if(dist(mouseX, mouseY, px[i], py[i]) < 20) {
px[i] += (mouseX - pmouseX);
py[i] += (mouseY - pmouseY);
px[i] = constrain(px[i], 5, width-5);
py[i] = constrain(py[i], 5, height-5);
}
}
}](http://24.media.tumblr.com/tumblr_m2bi2ybVTb1qg44uxo1_500.png)

![ActionScript 3.0: HYPE framework
This exercise employs the HYPE framework, a very cool library to generate animation and visual effects.
import hype.extended.behavior.MouseFollowSpring;
import hype.framework.display.BitmapCanvas;
import hype.extended.rhythm.FilterRhythm;
import hype.framework.core.TimeType;
var rastro:Sprite = new Sprite();
var figura:MovieClip = new Figura();
rastro.addChild(figura);
addChild(rastro);
var sigueme:MouseFollowSpring = new MouseFollowSpring(figura, 0.5, 0.2);
sigueme.start();
var escenario:BitmapCanvas = new BitmapCanvas(600, 300);
escenario.startCapture(rastro, true);
addChild(escenario);
var blur:BlurFilter = new BlurFilter(7, 5, 3);
var blurRhythm:FilterRhythm = new FilterRhythm([blur], escenario.bitmap.bitmapData);
blurRhythm.start(TimeType.ENTER_FRAME, 3);
See the SWF in action](http://25.media.tumblr.com/tumblr_ljjswvEEhr1qg44uxo1_500.png)
