Slicing Triangles / Shatter effect
Please take a look at this first:
http://board.flashkit.com/board/show....php?p=3818672
In effect what I'm doing is taking a random point in a box of the center maybe 25 pixels in from each side of the stage at random. This is my control point. Then I run a few loops a populate an array with points that run along the edges of the stage. These are the other two corners of each triangle to slice. I literally grabbed the code directly out of render's "sloppy" fla with minimal comments, but I've run into an issue. I'm fairly certain that I could get each shattered piece to rotate correctly to give it that "feel" of each piece spinning wildly away from the epicenter of the shatter. The problem lies in grabbing said triangles at all. In my tests, I've basically ripped render's code with hopes of eventually manipulating it to my needs, but 95% of the time I don't get an output bmd and when I do, it's skewed terribly.
What I'd basically like to do is grab the entire "stage" into a bitmap and shatter that. As a reference, after I slice all the triangles but before I move any of them, you shouldn't be able to tell a difference between the original stage and all the pieces. I've read that a bit of quality is lossed in renders method so is this not possible?
http:///97.84.174.160:1180/pics/ex1.png
You can see in the first picture what the stage might look like. In the second example I've added lines to show you what the pieces would look like, where the focal point of the shatter is, and how I went about generating points around the outside. In reality the lines wouldn't be there so before and after I slice the triangles (but before they're moved), both states would look like the first image.
I eventually would like to take normals of some of those tangent lines and split each triangle up again into smaller segments, but I don't want to get ahead of myself because I'm still not convinced this will work right. I have a copy of a DistortImage class I found a while back that I could use to spin the pieces, but not a convenient working way to slice them all without distortion.