labs.insert-title.com

Fun with spirals

A tutorial and swish scource code for generating a spiral gives our first inkling into pseudo-physics in Swishmax

The Script


function settings(){
    angle=45;
    x=150;
    r=1;
    y=150;
    _root.createEmptyMovieClip("holder",0);
    holder.lineStyle(0, 0x000000, 100);
    holder.moveTo(x+r, y);
    a = Math.tan(22.5 * Math.PI/180);    
    
    }
onLoad() {
settings();
    
}
onframe(1){
        var endx = r*Math.cos(angle*Math.PI/180);
        var endy = r*Math.sin(angle*Math.PI/180);
        var cx =endx + r*a*Math.cos((angle-90)*Math.PI/180);
        var cy =endy + r*a*Math.sin((angle-90)*Math.PI/180);
        holder.curveTo(cx+x, cy+y, endx+x, endy+y);
}
onframe(2){
angle+=45;
r++;
if(r>200){holder.clear();settings();}
gotoandplayPrev();
}

Fun with this script

This is one of those scripts you can play with endlessly, like spirograph. Here's a minor modification made simply by changing the r(radius) value to -200 and. I change the "if(r>200)" bit to "if(r>225)" just to hold the look of the finished spiral al ittle longer.

The Download(s)

Download swish file #1

Download swish file #2





Discussion

Alex

This is very cool!

Jim

getting very sleepy

jim

Liked the spiral

had a play and came up with this by changing the angle

http://www.ben.the-topflat.co.uk/spiral.htm

Jim

New comments are currently disabled, you can find me @joemaddalone Comments temporarily disabled for now, you can find me @joemaddalone