d3d_model_vertex_normal_texture_colour

Defines a primitive vertex for a textured model in 3D along with its corresponding normal, colour blending and alpha.

Syntax:

d3d_model_vertex_normal_texture_colour(ind, x, y, z, nx, ny, nz, xtex, ytex, 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.
xn The x component of the normal vector.
yn The y component of the normal vector.
zn The z component of the normal vector.
xtex Starting x coordinate within the texture (0 - 1).
ytex Starting y coordinate within the texture (0 - 1).
col The colour to blend with the vertex (c_white or -1 is no blend).
alpha The alpha of the vertex (0 - 1).


Returns: N/A


Description

This function defines the position of a primitive vertex for a model, assigns a normal to that vertex for the purposes of lighting and then assigns a texture as well as a blend colour and alpha transparency. The final look of the model will depend on the primitive type chosen to draw, the order with which you add the vertexes to it, and the normal that you define for it as well as the lighting. See d3d_model_primitive_begin for more information on primitives. To end and draw the primitive you must call d3d_model_primitive_end.


Example:

m = d3d_model_create();
d3d_model_primitive_begin(m, pr_trianglelist);
d3d_model_vertex_normal_texture_colour(-128, 0, -48, 0, 0.5, -0.5, 0, 0, c_lime, 0.5);
d3d_model_vertex_normal_texture_colour(-128, 96, 48, 0, 0.5, -0.5, 1, 0, c_lime, 0.5);
d3d_model_vertex_normal_texture_colour(128, 0, -48, 0, 0.5, -0.5, 0, 0.5, c_lime, 0.5);
d3d_model_vertex_normal_texture_colour(128, 0, -48, 0, 0.5, -0.5, 1, 0.5, c_lime, 0.5);
d3d_model_vertex_normal_texture_colour(-128, 96, 48, 0, 0.5, -0.5, 0, 1, c_lime, 0.5);
d3d_model_vertex_normal_texture_colour(128, 96, 48, 0, 0.5, -0.5, 1, 1, c_lime, 0.5);
d3d_model_primitive_end(m);

The above code will add a textured, sloped rectangle with the correct normal vectors for lighting, blended green and with a semi-transparent alpha to the selected model.


Back: 3D Drawing
Next: d3d_model_block
© Copyright YoYo Games Ltd. 2015 All Rights Reserved