Canvas.drawVertices 为Canvas.drawBitmapMesh的通用格式, BitmapMesh 请参见 Android ApiDemos示例解析(55):Graphics->BitmapMesh
同样为图像加上绿色网格以便更好的显示drawVertices 效果:
canvas.drawVertices(Canvas.VertexMode.TRIANGLE_FAN, 10, mVerts, 0,
mTexs, 0, null, 0, null, 0, 0, mPaint);
canvas.translate(0, 240);
canvas.drawVertices(Canvas.VertexMode.TRIANGLE_FAN, 10, mVerts, 0,
mTexs, 0, null, 0, mIndices, 0, 6, mPaint);
具体算法不详述了,Canvas.VertexMode ,可以参见下图:
TRIANGLES
每隔三个顶点构成一个三角形,为多个三角形组成。
TRIANGLE_STRIP
每相邻三个顶点组成一个三角形,为一系列相接三角形构成。
TRIANGLE_FAN
以一个点为三角形公共顶点,组成一系列相邻的三角形。
- 大小: 13.3 KB
- 大小: 17.1 KB
- 大小: 19.3 KB
- 大小: 151.5 KB
分享到:
相关推荐
Welding Vertices in a Mesh Making Lots of Little Meshes Out of One Big One In Brief Chapter 8. Understanding Resources Starting with the Resource Class Using the Vertex and Index Buffers ...
The GL Utilities (GLU) library is a set of routines designed to comple- ment the OpenGL graphics system by providing support for mipmapping, matrix manipulation, polygon tessellation, quadrics, NURBS,...
Eule-Poincaré formula v-e+f=2-2h v: number of vertices e: number of edges f: number of faces h: number of holes 01/04/2007 State Key Lab of CAD&CG 7 Examples of implicit surfaces ...
6. Buffer-Free Generation of Triangle Strip Cube Vertices Don Williamson (Celtoys) 7. Edge-Preserving Smoothing Filter for Particle Based Rendering Kin-Ming Wong (The Chinese University of Hong Kong)...
Geometry, vertices, and primitives: inputting geometry into the pipeline, and assembling it into primitives 2D/3D, Cubemap, Array texturing: creation, loading, and rendering; texture wrap modes, ...
Vertices and indices are stored in resources created through the device. Chapter 6 covers vertex transformations, vertex blending and user-de¯ned clipping planes. With transformations, primitives ...
#include <GL/glut.h> void main(int argc, char **argv) { glutInit(&argc;, argv); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); glutInitAWindowSize(500,500); glutInitWindowPosition(0,0); glutCreateWindow...
vec<f64>, hole_indices:&vec<usize>, dimensions:usize) 。vertices是顶点坐标的平面数组,如[x0,y0, x1,y1, x2,y2, ...] 。如果有的话,holes是一个Kong索引数组(例如,[5, 8]对于 12 个顶点
5.5.3 androidgraphics:满足绘图需求 5.5.4 androidfastrenderview 5.6 androidgame:合并所有内容 5.7 小结 第6章 mr. nom入侵android 6.1 创建资源 6.2 建立项目 6.3 mrnomgame:主要活动 6.3.1 ...
5.5.3 AndroidGraphics:满足 绘图需求 174 5.5.4 AndroidFastRenderView 178 5.6 AndroidGame:合并所有 内容 180 5.7 小结 184 第6章 Mr. Nom入侵Android 185 6.1 创建资源 185 6.2 建立项目 ...
In computer aided geometric design (CAGD) and computer graphics, it is a general manipulation to approximate a surface by triangulation mesh.<BR>Thus a key problem is to estimate the error of the ...