d3d_model_vertex_texture(ind, x, y, z, xtex, ytex)
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. |
xtex | Starting x coordinate within the texture. |
ytex | Starting y coordinate within the texture. |
Returns: N/A
This function defines the position of a textured vertex for a
primitive in a model. The final look of the primitive will depend
on the primitive type chosen to draw (See d3d_model_primitive_begin
for more information), the order with which you add the vertexes to
it and the position of the start point you set for the texture. To
end and draw the primitive you must call d3d_model_primitive_end.
model = d3d_model_create();
d3d_model_primitive_begin(model, pr_trianglestrip);
d3d_model_vertex_texture(model, 0, 480, 0, 0, 0);
d3d_model_vertex_texture(model, 640, 480, 0, 1, 0);
d3d_model_vertex_texture(model, 640, 480, 1000, 1, 1);
d3d_model_vertex_texture(model, 0, 480, 1000, 0, 1);
d3d_model_primitive_end(model);
The above code will draw a 4 vertex triangle strip textured with the texture held in the "tex" variable.