d3d_primitive_end

Ends the process of defining a primitive in 3D.

Syntax:

d3d_primitive_end()


Returns: N/A


Description

This function must be called when you have finished defining the points of your primitive. If you do not call this function, nothing will be drawn as this effectively tells GameMaker: Studio that you have finished and that it can now draw the defined primitive.


Example:

d3d_primitive_begin(pr_trianglelist);
d3d_vertex_colour(100, 100, 0, c_blue, 0.1);
d3d_vertex_colour(100, 200, 0, c_blue, 0.1);
d3d_vertex_colour(150, 150, 200, c_red, 1);
d3d_vertex_colour(100, 200, 0, c_blue, 0.1);
d3d_vertex_colour(200, 200, 0, c_blue, 0.1);
d3d_vertex_colour(150, 150, 200, c_red, 1);
d3d_vertex_colour(200, 200, 0, c_blue, 0.1);
d3d_vertex_colour(100, 100, 0, c_blue, 0.1);
d3d_vertex_colour(150, 150, 200, c_red, 1);
d3d_vertex_colour(100, 100, 0, c_blue, 0.1);
d3d_vertex_colour(100, 200, 0, c_blue, 0.1);
d3d_vertex_colour(200, 200, 0, c_blue, 0.1);
d3d_primitive_end();

The above code will draw a tetrahedron standing on the z=0 plane with its top coloured red and fully opaque at z = 200, while its base will be blue and transparent.


Back: 3D Drawing
Next: d3d_primitive_begin_texture
© Copyright YoYo Games Ltd. 2018 All Rights Reserved