| Home | zeGraph lib | Lua lib | Custom lib | Tutorials | Notes | XML Script | C-Talk | Z-Script |
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19

Lesson 3 Vertex, Color, and Texture Coodinate

zeVertex, zeColor, and zeTexCoord are data objects for making up shapes of point, line, and polygon. Their uses are very simple: the add() function adds datasets to the end; the clear() function removes all data from the objects; the size() function returns the number of datasets; and the get() function returns a data record. The zeVertex has a few more functions for transformation of data. Overall the interfaces of these objects are limited to keep the core library small and runs fast. To further manipulate data of vertex, colors, and texture coordinate, it is better to use the double floating type of zeArray object, which is discussed in Lesson 10.

A dataset of zeVertex has three components (x, y, and z), which can be used to represent a vertex or or vertex normal; a dataset of zeColor has four components (red, green, blue, alpha); and a dataset of zeTexCoord has two components (s, t) for 2D-texture coordinates. Components of zeColor and zeTexCoord should range from 0 to 1.

A zeVertex, zeColor, or zeTexCoord can be shared by multiple shape objetcs.