Author Archives: Zevan

Gumowski/Mira Pseudo-Soundwave

CLICK HERE TO COPY
Actionscript:

[SWF(width = 600, height = 600)]

var a:Number = 0.02;

var b:Number = .9998;

 

var xn1:Number = 5;

var yn1:Number = 0;

var xn:Number, yn:Number;

 

var scale:Number = 10;

var iterations:Number = 20000;

var step:Number = stage.stageWidth / iterations;

 

function f(x:Number):Number{

    var x2:Number = x * x;

    return a * x + (2 * (1 - a) * x2) [...]

Posted in BitmapData, Graphics, Math, graphics algorithms | Leave a comment

Closest Point on a Line

CLICK HERE TO COPY
Actionscript:

// from

// http://www.gamedev.net/topic/444154-closest-point-on-a-line/

 

function getClosestPoint(A:*, B:*, P:*, segmentClamp:Boolean=true):Point {

    var AP:Point = new Point(P.x - A.x, P.y - A.y),

        AB:Point = new Point(B.x - A.x, B.y - A.y);

    var ab2:Number=AB.x*AB.x+AB.y*AB.y;

    var ap_ab:Number=AP.x*AB.x+AP.y*AB.y;

    var t:Number=ap_ab/ab2;

    if (segmentClamp) {

        if (t<0.0) {

      [...]

Posted in Math | Leave a comment

Stereoscopic Papervision

Cross your eyes to see 3D third image:

Posted in 3D | Tagged | 1 Comment

ActionSnippet.zip

2018 UPDATE: grab the zip here http://actionsnippet.com/actionsnippet.zip
Seems I missed a good 15-20 requests over the years - so here it is ^^
Who would like a zip of the folder I used when making this site fla files and all? If you want one, post a comment and I'll send it to you.
Actually have a little [...]

Posted in Uncategorized | 59 Comments