d3d_model_vertex_colour

Add vertex (x,y,z) to the model with colour values.

Syntax:

d3d_model_vertex_colour(ind, x, y, z, col, alpha)


Argument Description
ind The index of the model to add the primitive to.
x The x coordinate of the vertex.
y The y coordinate of the vertex.
z The z coordinate of the vertex.
col The colour to blend with vertex.
alpha The alpha value of the vertex.


Returns: N/A


Description

This function defines the position of a vertex of a primitive which is part of a model, and blends the specified colour and alpha with it. The final look of the primitive will depend on the primitive type chosen to draw and the order with which you add the vertexes to it. See d3d_model_primitive_begin for more information. To end and draw the primitive you must call d3d_model_primitive_end.


Example:

model[2] = d3d_model_create();
d3d_model_primitive_begin(model[2], pr_trianglestrip);
d3d_model_vertex_colour(model[2], 100, 100, 0, c_red, 1);
d3d_model_vertex_colour(model[2], 100, 200, 0, c_red, 1);
d3d_model_vertex_colour(model[2], 150, 150, 200, blue, 1);
d3d_model_vertex_colour(model[2], 100, 200, 0, c_red, 1);
d3d_model_vertex_colour(model[2], 200, 200, 0, c_red, 1);
d3d_model_vertex_colour(model[2], 150, 150, 200, blue, 1);
d3d_model_vertex_colour(model[2], 200, 200, 0, c_red, 1);
d3d_model_vertex_colour(model[2], 100, 100, 0, c_red, 1);
d3d_model_vertex_colour(model[2], 150, 150, 200, blue, 1);
d3d_model_vertex_colour(model[2], 100, 100, 0, c_red, 1);
d3d_model_vertex_colour(model[2], 100, 200, 0, c_red, 1);
d3d_model_vertex_colour(model[2], 200, 200, 0, c_red, 1);
d3d_model_primitive_end(model[2]);

The above code will define a coloured tetrahedron and add it to the model.


Back: 3D Models
Next: d3d_model_vertex_texture
© Copyright YoYo Games Ltd. 2018 All Rights Reserved