I would like to draw triangles, and polygons
To draw a triangle I use this method that I found on internet :
this.p.setStyle(Paint.Style.STROKE);
int triangleColors[] = {
this.p.getColor(), this.p.getColor(), this.p.getColor(),
this.p.getColor(), this.p.getColor(), this.p.getColor()
};
float verts[] = {
ptsFloat.get(0).x, ptsFloat.get(0).y,
ptsFloat.get(1).x, ptsFloat.get(1).y,
ptsFloat.get(2).x, ptsFloat.get(2).y
};
c.drawVertices(Canvas.VertexMode.TRIANGLES,
verts.length,
verts,
0,
null,
0,
triangleColors,
0,
null,
0,
0,
this.p);
But the result is null, I've nothing drawn ... Whereas, drawLine, drawCircle works perfectly well, have you any idea why this method doesn't work ? Futhermore, I don't have any traces in my logcat console for helping me !