Game Development Reference
In-Depth Information
The complete source code for these functions is found in the GeomServ.cpp ile in the 3_
ShadersAndVertexArrays project. Now we have a set of handy functions to create simple
2D and 3D geometry primitives, such as single triangles, rectangles, and boxes.
There's moreā€¦
If you want to learn how to create more complex 3D primitives, download the source code for
Linderdaum Engine ( http://www.linderdaum.com ). In Geometry/GeomServ.h , you will
ind out how to generate spheres, tubes, polyhedra, gears, and other 3D objects.
See also
F Unifying vertex arrays
Unifying vertex arrays
Geometry data is submitted into OpenGL using Vertex Buffer Objects (VBO) and Vertex Array
Objects (VAO). VBOs are part of both OpenGL versions; however, VAOs are not part of OpenGL
ES 2 but are mandatory in the OpenGL 3.2 Core Proile. This means we have to make yet
another abstraction to hide the difference between the two APIs behind it.
A Vertex Buffer Object ( VBO ) is an OpenGL feature that provides methods for
uploading vertex data (position, normal vector, color, and so on) to the video device
for non-immediate-mode rendering. VBOs offer substantial performance gains over
immediate mode rendering, primarily because the data resides in the video device
memory rather than the system memory and so it can be rendered directly by the
video device.
Courtesy: http://en.wikipedia.org/wiki/Vertex_Buffer_Object
A Vertex Array Object ( VAO ) is an OpenGL Object that encapsulates the state
needed to specify vertex data. They deine the format of the vertex data as well as
the sources for the vertex arrays. VAOs do not contain the arrays themselves; the
arrays are stored in Buffer Objects. The VAOs simply reference already existing
buffer objects.
Courtesy: http://www.opengl.org/wiki/Vertex_Specification
Getting ready
Before proceeding with vertex arrays, make sure you are familiar with the platform-
independent storage of geometry from the previous recipe. The source code for this recipe
can be found in the 4_Canvas example. Take a look at the GLVertexArray.cpp and
GLVertexArray.h iles.
 
Search WWH ::




Custom Search