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
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.
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.