d3d_draw_wall

Draws a simple 3D vertical wall.

Syntax:

d3d_draw_wall(x1, y1, z1, x2, y2, z2, tex, hrepeat, vrepeat)


Argument Description
x1 The initial x coordinate of the wall.
y1 The initial y coordinate of the wall.
z1 The initial z coordinate of the wall.
x2 The opposite x coordinate of the wall.
y2 The opposite y coordinate of the wall.
z2 The opposite z coordinate of the wall.
tex The id of the texture to use (-1 for no texture)
hrepeat Amount of horizontal repetitions for the texture.
vrepeat Amount of vertical repetitions for the texture.


Returns: N/A


Description

This function draws a simple wall in 3D space. You set the first corner coordinates (x1,y1,z1) and then the coordinates for the opposite, lower corner. You can also specify a texture for the wall and the amount of times that you wish this texture to be repeated vertically and horizontally. If you do not wish to use a texture you can set this to -1 and the hrepeat and vrepeat values will be ignored. This function appears to be exactly the same as the function to draw a floor, but the way they work is actually quite different, as, with this, the end result will always be vertical in the 3D plane, as illustrated in the image below:

Note:If the texture has to repeat over the wall, the source texture must be a power of 2 in size (eg: 8x8, 128x128, 256x256 etc...), otherwise you can use any size texture.


Example:

var tex;
tex = background_get_texture(bck_Wall);
d3d_draw_wall(100, 140, 200, 20, 20, 0, tex, 1, 1);
d3d_draw_wall(240, 340, 200, 200, 320, 0, tex, 1, 1);

The above code stores a texture in the variable "tex" and then uses it to texture two walls that have been drawn at different positions.


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