topical media & game development
animation-ch16-Triangle.ax
animation-ch16-Triangle.ax
[swf]
[flash]
flex
package
{
import flash.display.Graphics;
public class @ax-animation-ch16-Triangle
{
private var pointA:animation_ch16_Point3D;
private var pointB:animation_ch16_Point3D;
private var pointC:animation_ch16_Point3D;
private var color:uint;
public function @ax-animation-ch16-Triangle(a:animation_ch16_Point3D, b:animation_ch16_Point3D, c:animation_ch16_Point3D, color:uint)
{
pointA = a;
pointB = b;
pointC = c;
this.color = color;
}
draw(s)
public function draw(g:Graphics):void
{
g.beginFill(color, .5);
g.moveTo(pointA.screenX, pointA.screenY);
g.lineTo(pointB.screenX, pointB.screenY);
g.lineTo(pointC.screenX, pointC.screenY);
g.lineTo(pointA.screenX, pointA.screenY);
g.endFill();
}
}
}
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.