d3d_model_vertex

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

Syntax:

d3d_model_vertex(ind, x, y, z)


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.


Returns: N/A


Description

This function defines the position of a vertex of a primitive which is part of a model. 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(model[2], 100, 100, 0);
d3d_model_vertex(model[2], 100, 200, 0);
d3d_model_vertex(model[2], 150, 150, 200);
d3d_model_vertex(model[2], 100, 200, 0);
d3d_model_vertex(model[2], 200, 200, 0);
d3d_model_vertex(model[2], 150, 150, 200);
d3d_model_vertex(model[2], 200, 200, 0);
d3d_model_vertex(model[2], 100, 100, 0);
d3d_model_vertex(model[2], 150, 150, 200);
d3d_model_vertex(model[2], 100, 100, 0);
d3d_model_vertex(model[2], 100, 200, 0);
d3d_model_vertex(model[2], 200, 200, 0);
d3d_model_primitive_end();

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


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