`
George_ghc
  • 浏览: 90828 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Graphics->Vertices

阅读更多

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
分享到:
评论

相关推荐

    Managed Directx 9 Kick Start - Graphics And Game Programming

    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 ...

    glu 1.3 specification

    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,...

    计算机辅助几何设计ImplicitSurfaceModeling.pdf

    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 ...

    Game Engine Gems 3 - Eric Lengyel

    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)...

    OpenGL ES 3.0 Programming Guide, 2nd Edition

    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, ...

    D3D render pipeline

    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...

    MapBox 的耳切三角测量代码移植到 Rust 语言

    vec<f64>, hole_indices:&vec<usize>, dimensions:usize) 。vertices是顶点坐标的平面数组,如[x0,y0, x1,y1, x2,y2, ...] 。如果有的话,holes是一个Kong索引数组(例如,[5, 8]对于 12 个顶点

    Android 4游戏编程入门经典

     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 ...

    android游戏编程入门

     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 建立项目 ...

    The sharp upper bound on the distance between a parametric patch and its interpolated triangle

    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 ...

Global site tag (gtag.js) - Google Analytics