d3d_model_block

Adds a block shape to the model.

Syntax:

d3d_model_block(ind, x1, y1, z1, x2, y2, z2, hrepeat, vrepeat)


Argument Description
ind The model index to add the block to.
x1 The initial x coordinate of the block.
y1 The initial y coordinate of the block.
z1 The initial z coordinate of the block.
x2 The opposite x coordinate of the block.
y2 The opposite y coordinate of the block.
z2 The opposite z coordinate of the block.
hrepeat Amount of horizontal repetitions for the texture.
vrepeat Amount of vertical repetitions for the texture.


Returns: N/A


Description

This function will add a block of the specified size to the chosen model. Please note that the x1, y1 and z1 parameters should be smaller than the x2, y2 and z2 to get the correct shape. There may be occasions where you want the box to be inverted though (for example if you want the camera to be inside the block) in which case swapping the two sets of coordinates will achieve this.


Example:

model[0] = d3d_model_create();
d3d_model_block(model[0], -10, -10, -10, 10, 10, 50, 1, 1);

The above code creates a model and adds a block to it.


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