I’m more or less at wit’s end now. I managed to get something all displace-y to show up on my screen, but it’s not working properly, and to be honest, I’m not sure what it’s doing.
All I want to happen is this: I’ve defined a BitmapData object that contains a circlular Sprite with a radial gradient fill. I’ve tried changing said Sprite’s colors from alpha to red to alpha and 0x808080 to 0xFF0000 to 0x808080, just to see if that made a difference. It didn’t.
I get a square displacement map, regardless of what colors the actual map is. I’ve changed the DisplacementMapFilterMode to pretty much everything, and while “stuff” happens, it’s not happening correctly – or how I want it to happen, at least
Here’s how I’m defining my map:
var myDMF:DisplacementMapFilter=new DisplacementMapFilter();
myDMF.mapBitmap=myBitmapData;
myDMF.mapPoint=new Point(myParent.mouseX-(myBitmapData.width*0.5), myParent.mouseY-(myBitmapData.height*0.5));
myDMF.componentX=BitmapDataChannel.RED;
myDMF.componentY=BitmapDataChannel.RED;
myDMF.scaleX=50;
myDMF.scaleY=50;
myDMF.mode=DisplacementMapFilterMode.IGNORE;
myDMF.color=0;
myDMF.alpha=0;
myParent.filters=[];
myParent.filters=[myDMF];
The scale values are just to test for effect. Additionally, I’m not sure if I’m doing the correct thing with the mapPoint attribute…
My thought was that by creating the bitmap data object I’ve created, I could use that as a displacement map and, through animation, get some kind of rippling effect.
I have the “rippling” behaving as I wanted (more or less), but I can’t get the displacement map to work properly. Here are my files, for anyone who might be able to help. Thanks!