Member-only story
Learning Android Development
Playing with Android canvas drawVertices
Making triangle into 3-d art like images

If you like some simple graphic drawing in Android Canvas, drawVertices
is a pretty nice API to use. It could be used as the fundamental for drawing 3D images as shown below.

Anyway, before getting into that complexity, let’s learn the fundamental of the API.
I was searching for some tutorial explaining it and can’t any one for Android. So do some experiments and learn the API to share below.
Have fun!
Prerequisite
Unlike most of the API in the Canvas
, in order to drawVertices
to draw something, one need to disabled the Hardware Acceleration first using
setLayerType(View.LAYER_TYPE_SOFTWARE, null)
Why? It is simply because it is one of the unsupported feature in Hardware Acceleration as per documented at the point of writing this blog.
The API
The API have 12 arguments. 😱 Wow!
public void drawVertices (…