2012年5月4日星期五

Grossiste chaussures/ / create a scene rendering device this.

Murmur( billman ) personal original ,welcome to reprint ,the reprint please give the address ,but the column address ( billman ) : http: / / blog.csdn.net / bill_man 1.openGLESopenGLES ( OpenGLforEmbeddedSystem ) is designed for embedded equipment design of a subset of OpenGL ,also joined some extensions ,can achieve the purpose of reducing power consumption of mobile equipment .
2 polygon andtriangle 3D models in basic unit is the vertex ,a multilateral type ,polygons constituting the 3D world,the OpenGLES performance based considerations only through the support of triangles to form a polygon .
For example, a cube has six faces ,each face can be split into two triangles ,a total of 12triangles.OpenGLES uses a three-dimensional Cartesian coordinate system, the scene construction all or part of an object at the apex of the X ,Y ,Z coordinates & # 20540;as well as the vertex array is given 3draw trianglewhole frame is the first entrance class Activity promoter ,and then start the adoption of Activity a GLSurfaceView ,then the GLSurfaceView starts a renderer ,specific methods are as follows : myRenderer = newSceneRenderer ( ) ;/ / create a scene rendering device this.
setRenderer ( myRenderer ) ;/ / set the renderer ( GLSurfaceView.RENDERMODE_CONTINUOUSLY this.setRenderMode ) ;/ / set the blend mode to active rendering the renderer class is our own implementation ,inherited from the GLSurfaceView and Renderer we rewrite of the onDrawFrame method called on us his painting it in descriptive parameters need data cache class parameter ,this parameter construction methods are as follows first allocate the memory of ByteBuffervbb = ByteBuffer.
allocateDirect ( vertices.length * 4 );because the vertex parameters is an integer, so compared to Byte ,vertices array length should be multiplied by 4 (vertices Vertex vertex array ) is an integer then set this byte buffer byte order for local platforms byte order vbb.
order ( ByteOrder.nativeOrder ( ) ) ;and then can be converted to the int buffer ,into coordinate data ,set the initial position of myVertexBuffer = vbb.asIntBuffer ( ) ;myVertexBuffer.
put ( vertices ) ;myVertexBuffer.position ( 0);then returned to draw a triangle this topic, four steps can be firstly some initialization vertex array Grossiste chaussures,enabling the array of colors gl.glEnableClientState (GL10.
GL_VERTEX_ARRAY ) ;/ / vertex coordinates array gl.glEnableClientState ( GL10.GL_COLOR_ARRAY ) ;/ / vertex array of colors and then brush specify the vertex coordinate data of gl.glVertexPointer ( 3,GL10.
GL_FIXED ,0,myVertexBuffer ) ;the first parameter is the number of vertices ,a set of second parameters coordinate for plastic surgery ,third for vertex coordinates between interval ,the last for the earliest we defined data cache parameters and then are for the brush to specify color and index data of gl.
glColorPointer ( 4,GL10.GL_FIXED ,0,myColorBuffer ) ;gl.glDrawElements ( GL10.GL _ TRIANGLES ,iCount ,GL10.GL_UNSIGNED_BYTE ,myIndexBuffer ) ;gl.glColorPointer parameters with glVertexPointer ,glDrawElements parameter is the first type of padding ,here is the triangle filling ,the second parameter is the number of vertices ,third parameters are caching data type ,here is the byte ,the last parameter is a type parameter data cache .
Well, here ,we basically can build a openGLES application reference from Android3d game development techniques detailed and typical cases ,such as mistakes, hope that a lot of correction
Source by the beats by dre relate article:

没有评论:

发表评论