4 Replies Latest reply on Sep 9, 2010 12:33 AM by IlyaG

# Need help with Page-Flip effect - working with bitmap and Matrix

Hi, I am trying to build page-flip effect according to this tutorial: http://demo.quietlyscheming.com/book/walkthrough.html

I don't wont to download open source, just wont to do it by my self... So I have few questions:

1) How can I create bitmap component from Canvas or Image?

2) How can I create a polygon and fill it with Bitmap?

3) Can you tell me with what degree I have to rotate the Bitmap so it will be fine? This is what I been trying to do:

public function rotate(D:Point):void
{

const UNKNOWN:uint=0;

var B:Point = new Point(this.x+this.width,this.y);
var G:Point = new Point(this.x,UNKNOWN);
var m:Number = (B.y-D.y)/(B.x-D.x)
var c:Number = B.y-m*B.x;
G.y=G.x*m+c;
var GB:Number = Math.sqrt( (G.y-B.y)*(G.y-B.y)+(G.x-B.x)*(G.x-B.x) );
var EB:Number = this.width;
var EGB:Number = Math.asin(EB/GB);
var EBG:Number = 90-EGB/Math.PI*180;
var HDA:Number = 90-EBG*2;

this.rotation=(HDA);

}

Look at the attached file, this is the diagram