Hi list...

I'm trying to render a spherical earth using a DisplacementMapFilter out of a 
flat movieclip of the landmasses but it isn't working too well for me.  Any 
suggestions?  I'd appreciate hearing any ideas.

Thanks,
- Michael M.

private function renderOrnament():Sprite{
        var makeCirc:Function = function(isFront:Boolean, diam:uint):Shape{
                // used for masks and displacement
                var c:Shape = new Shape();
                var m:Matrix = new Matrix();
                m.createGradientBox(diam,diam);
                var colors:Array = (isFront != 
true)?[0xFFFFFF,0x000000]:[0x000000,0xFFFFFF];
                c.graphics.beginGradientFill(GradientType.RADIAL, 
colors,[1,1],[0,255],m);
                c.graphics.drawEllipse(0,0,diam,diam);
                c.graphics.endFill();
                return c;
        }
        // container
        var orn:Sprite = new Sprite();
        // front "hemisphere"
        var fh:Sprite = new Sprite();
        orn.addChild(fh);
        // front world (World is a mc of all the continents)
        frontWorld = new World();
        fh.addChild(frontWorld);
        // front world mask
        var circleMask:Shape = makeCirc(true,200);
        fh.addChild(circleMask);
        frontWorld.mask = circleMask;
        // front world displacement
        fh.filters = [new DisplacementMapFilter(new BitmapData(200,200), new 
Point(0,0), 1, 1,75, 75, DisplacementMapFilterMode.IGNORE, 1,0)];  
        return orn;
}



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to