d3d_model_primitive_begin

Begins the process of defining a primitive that is to be added to a model in 3D.

Syntax:

d3d_model_primitive_begin(ind, kind)


Argument Description
ind The index of the model to add the primitive to.
kind The kind of primitive you are going to draw.


Returns: N/A


Description

This function must be called before you can define any primitives for a model. There are 6 types of primitives you can define with the following constants:

The following image illustrates basically how these should look and also the order in which you should define the vertexes:


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(model[2]);

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


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