# Problem on graphics.drawTriangle

**URL:** <https://forum.kirupa.com/t/problem-on-graphics-drawtriangle/331197>\
**Category:** Uncategorized\
**Created:** [June 10, 2013, 7:18pm UTC](https://forum.kirupa.com/t/problem-on-graphics-drawtriangle/331197 "2013-06-10T19:18:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devon\_Yoo](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Devon\_Yoo](https://forum.kirupa.com/u/Devon_Yoo)\
**Post date:** [June 10, 2013, 7:18pm UTC](https://forum.kirupa.com/t/problem-on-graphics-drawtriangle/331197/1 "2013-06-10T19:18:50Z")

</div>

I am trying to do Triangle Affine transform but having a trouble…

```auto

var vertices:Vector.<Number> = Vector.<Number>([10,10, 100,10, 10,100, 150,150]);
var indices:Vector.<int> = Vector.<int>([0,1,2, 1,3,2]);
var uvtData:Vector.<Number> = Vector.<Number>([0,0, 1,0, 0,1, 1,1]);

var shape:Shape = new Shape();
shape.graphics.beginBitmapFill(bitmap.bitmapData);
shape.graphics.drawTriangles(vertices, indices, uvtData);
shape.graphics.endFill();

var output:Bitmap = new Bitmap(new BitmapData(bitmap.width, bitmap.height));
output.bitmapData.draw(shape);

```

The result bitmap looks like:

My result bitmap keeps having overlayed images in it and I don’t know why it happens…  
What is wrong in my code?
