WebGL Textures & Vertices
Vertices and Meshes Overview
A vertex represents a point in 3D or 2D space. A mesh represents a set of ordered vertices. The simplest mesh is a triangle composed of three vertices. Combine triangles to display meshes representing almost any form imaginable. For example prepare a few triangles, to display geometric volumes such as cubes and pyramids. Display complex meshes representing people, architecture, and landscapes. This book explains how to order vertices to display a mesh representing a square.
For readers who've studied algebra
the following Cartesian coordinate graph
should look familiar.
The illustration demonstrates a
Cartesian coordinate graph with
Y. The book's
values for numbers within the range
The center of the 2 dimensional graph is at point
The upper left corner is at point
The lower right corner is at point
Diagram 1: 2D Cartesian Coordinate Graph
The book's examples include values for the third
(0,0,0) represents one
vertex at the center or origin, of the graph.
(1,-1,-1) represents one vertex
in the lower right back corner of a 2 x 2 unit cube.
The following graphic demonstrates the third dimension with a cube.
The axis labeled
Z provides depth to a scene.
Diagram 2: Cube on with Three Axes
WebGL includes a conceptual viewport. You might think of the viewport as the monitor or a device's display screen. As the value of the Z coordinate decreases, a point recedes off into the distance. As the value of a the Z coordinate increases, a point moves toward the view screen.