d3d_model_vertex_texture_colour

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

Syntax:

d3d_model_vertex_texture_colour(ind, x, y, z, xtex, ytex)


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.
xtex Starting x coordinate within the texture.
ytex Starting y coordinate within the texture.
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 textured vertex for a primitive in a model, with the vertex blended with the specified colour and alpha values. The final look of the primitive will depend on the primitive type chosen to draw (See d3d_model_primitive_begin for more information), the order with which you add the vertexes to it and the position of the start point you set for the texture. To end and draw the primitive you must call d3d_model_primitive_end.


Example:

model = d3d_model_create(); d3d_model_primitive_begin(model, pr_trianglestrip);
d3d_model_vertex_texture_colour(model, 0, 480, 0, 0, 0, c_lime, 1);
d3d_model_vertex_texture_colour(model, 640, 480, 0, 1, 0, c_lime, 1);
d3d_model_vertex_texture_colour(model, 640, 480, 1000, 1, 1, c_lime, 1);
d3d_model_vertex_texture_colour(model, 0, 480, 1000, 0, 1, c_lime, 1);
d3d_model_primitive_end(model);

The above code will add a 4 vertex, textured triangle strip to the model, with the colour c_lime blended in and an alpha of 1.


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