Vertex Colored Cube
Download 3D Model & Vertex Colors
Download a free 3D model of a vertex colored cube. The model's prepared as a set of arrays useful with WebGL. Learn a little about how to use vertex colors in this very short article.
Each face of the cube displays a different color, prepared with red, green and blue vertex colors. Seven Thunder Software prepared the cube's vertex colors to map edge to edge over each face. The vertex colored cube should appear similar to the texture mapped cube.
Vertex colors provide color values per vertex on a 3D model. Models with vertex colors don't require texture maps. There's no need to download a separate image file to use as a texture map. Therefore, depending on the model, vertex colors offer a lightweight method to display 3D elements online.
Call WebGL API method
describe the order of data in the vertex buffer object (VBO).
The following listing demonstrates how to call
entity.aTexCoord is the location of an attribute in the
vertex shader, prepared to process red, green, blue and alpha color channel values.
Assign four values for the attribute to process color data.
The next section describes the structure of data uploaded to the VBO,
from arrays provided with this model.
gl.vertexAttribPointer ( entity.aTexCoord, 4, gl.FLOAT, gl.FALSE, 28, 12 );
Float32Array arranged with interleaved
texels and RGBA color values, describes the shape and color of the cube.
For example numbers,
the following listing, represent X, Y, and Z coordinates of the first vertex.
0.670588,0,0.584314,1.0, represent red, green, blue and alpha color data
for the first vertex.
Download Vertex Colored Cube 3D Model
Either select the
CubeVC.js button, below, or the cube image link, to
download the 3D model.
3D Models & Texture Maps