The problem with drawing in the traditional (2D) way is that a sprite or polygon always lies in the xy-plane, that is, all corners have the same depth. For true 3D you want to be able to have vertices at different
depths, and this depth is called the z-axis. So from this moment on we will talk about z-coordinate rather than depth, and we will specify coordinates as (x,y,z) tuples. It should also be noted that unless the
colour or alpha is set by the function itself, you can use draw_set_colour and
draw_set_alpha to set the drawing colour and alpha of the object being drawn.
For drawing basic primitives in 3D mode with these x,y,z coordinates we have the following functions:
For drawing textured primitives in 3D mode with these x,y,z coordinates we have the following functions (to end drawing use the d3d_primitive_end() function above):
You are not limited to just drawing your own shapes made from primitives either , as GameMaker: Studio has a set of functions that allow you to draw pre-defined shapes at any point in the 3D environment, with (or without) a texture mapping too (note that these functions can also be used with backface culling switched on):