Fuse, DisplacementMapFilter and envelope distortion: a further experiment

Posted on Sunday 1 October 2006

Building on the last experiment, here is the same kind of transition, this time with envelope distortion, that warps a rectangle into an inward curved "thing"; it looks as though is it being pinched, while the 4 corners stay put. Here's the source. The function to generate the displacement map is simple enough:


function createPinchMap(width, height)
{
        var bmp:BitmapData = new BitmapData(width, height, false, 0xffffff);
        for(var j = 0; j < height; j++)
        {
                for(var i = 0; i < width; i++)
                {
                        var blueCol = 127 + (i - width/2) /(width/2) *127*(1 - Math.pow((j - height/2)/(height/2), 2));
                        var greenCol  = 127 + (j - height/2)/(height/2)*127*(1 - Math.pow((i - width/2) /(width/2) , 2));
                        bmp.setPixel(i, j, (greenCol << 8) | blueCol);
                }
        }
        return bmp;
}
 

Home exercise: you've all seen Grant Skinner's morphing Mike Chambers contest. Instead of morphing Mike Chambers into Mike Chambers, morph him into somebody else (the person is up to you). This, I am confident, can be done quite simply with Fuse and DisplacementMap. If you need a head-start, read this article, but please don't morph Mike Chambers into a sheep! First prize gets recognition from everyone in the community, and the consequent money, sex, drugs, and/or rock and roll (not necessarily in that order).


WordPress database error: [Can't open file: 'wp_comments.MYD'. (errno: 145)]
SELECT * FROM wp_comments WHERE comment_post_ID = '209' AND comment_approved = '1' ORDER BY comment_date

No comments have been added to this post yet.

Leave a comment




Your e-mail address is never displayed. If you run into issues with SpamKarma blocking you, email me at $patrick->5etdemi(com)


RSS feed for comments on this post | TrackBack URI