13.07.2015 Views

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Tutorial on Drawing 3D Shapes...-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, //BACK xyz for vertices, uv for texture-0.5f, 0.5f, -0.5f, 1.0f, 0.0f,0.5f, -0.5f, -0.5f, 0.0f, 1.0f,// -0.5f, 0.5f, -0.5f, 1.0f, 0.0f,// 0.5f, -0.5f, -0.5f, 0.0f, 1.0f,// 0.5f, 0.5f, -0.5f, 1.0f, 1.0f,-0.5f, -0.5f, 0.5f, 0.0f, 0.0f, //LEFT xyz for vertices, uv for texture-0.5f, 0.5f, 0.5f, 1.0f, 0.0f,-0.5f, -0.5f, -0.5f, 0.0f, 1.0f,// -0.5f, 0.5f, 0.5f, 1.0f, 0.0f,// -0.5f, -0.5f, -0.5f, 0.0f, 1.0f,// -0.5f, 0.5f, -0.5f, 1.0f, 1.0f,0.5f, -0.5f, -0.5f, 0.0f, 0.0f, //RIGHT xyz for vertices, uv for texture0.5f, 0.5f, -0.5f, 1.0f, 0.0f,0.5f, -0.5f, 0.5f, 0.0f, 1.0f,// 0.5f, 0.5f, -0.5f, 1.0f, 0.0f,// 0.5f, -0.5f, 0.5f, 0.0f, 1.0f,// 0.5f, 0.5f, 0.5f, 1.0f, 1.0f,-0.5f, 0.5f, 0.5f, 0.0f, 0.0f, //TOP xyz for vertices, uv for texture0.5f, 0.5f, 0.5f, 1.0f, 0.0f,-0.5f, 0.5f, -0.5f, 0.0f, 1.0f,// 0.5f, 0.5f, 0.5f, 1.0f, 0.0f,// -0.5f, 0.5f, -0.5f, 0.0f, 1.0f,// 0.5f, 0.5f, -0.5f, 1.0f, 1.0f,-0.5f, -0.5f, 0.5f, 0.0f, 0.0f, //BOTTOM xyz for vertices, uv for texture-0.5f, -0.5f, -0.5f, 1.0f, 0.0f,0.5f, -0.5f, 0.5f, 0.0f, 1.0f,// -0.5f, -0.5f, 0.5f, 0.0f, 0.0f,// -0.5f, -0.5f, -0.5f, 1.0f, 0.0f,// 0.5f, -0.5f, -0.5f, 1.0f, 1.0f,}2. Change the number of triangles as shown in Example 4-16:Example 4-16 Drawing 11 triangles......glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);context->drawArrays(GL_TRIANGLES, 0, 6); // draw each triangle}while ( context->update() );3. Rebuild the project and run it. Figure 4-4 shows the shape with half of the trianglesremoved:Figure 4-4 The cube shape with half of the triangles removedARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 4-13ID070710Non-Confidential - Draft - Beta

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!