d3d_model_create()
Returns: real
This function must be called before you can define a new model, and it returns the index of that model which must be stored in a variable and referenced in all further functions that you wish to use
with that model. As with most created resources, when you no longer need the model you should remove it from memory by using the d3d_model_destroy
function or else you will have a memory leak that will slow down and eventually crash your game.
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(model[2]);
The above code will define a tetrahedron and add it to the model indexed by the variable "model[2]".