Book Image

OpenGL ES 3.0 Cookbook

By : Parminder Singh
Book Image

OpenGL ES 3.0 Cookbook

By: Parminder Singh

Overview of this book

<p>"Write once, use anywhere" is truly the power behind OpenGL ES and has made it an embedded industry standard. The library provides cutting-edge, easy-to-use features to build a wide range of applications in the gaming, simulation, augmented-reality, image-processing, and geospatial domains.</p> <p>The book starts by providing you with all the necessary OpenGL ES 3.0 setup guidelines on iOS and Android platforms. You'll go on to master the fundamentals of modern 3D graphics, such as drawing APIs, transformations, buffer objects, the model-view-project analogy, and much more. The book goes on to deal with advanced topics and offers a wide range of recipes on the light shading, real-time rendering techniques with static and procedure textures to create stunning visualizations and runtime effects.</p>
Table of Contents (21 chapters)
OpenGL ES 3.0 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Rendering primitives with vertex arrays


In OpenGL ES 3.0, the vertex array is a simplest mean to draw the objects in the 3D space. The objects are drawn with the help of vertices, which are arranged in a specific order guided by the rendering primitives. The rendering primitives represent how an individual or a set of vertices can assemble to draw a geometry. For example, four vertices can be represented by a point, line, or triangle, as shown here:

The vertex array is the way in which the geometric data, such as vertex coordinates, normal coordinates, color information, and texture coordinates, are specified in the form of arrays. In this recipe, you will learn to program a vertex array in the GLPI framework. In addition to this, we will also demonstrate various available rendering primitives in OpenGL ES 3.0.

How to do it...

Create a new class called Primitive derived from the Model class and follow this step-by-step procedure to implement the rendering primitive with the vertex array:

  1. Create...