d3d_transform_add_translation

Add a translation over the indicated vector to the transform.

Syntax:

d3d_transform_add_translation(xt, yt, zt)


Argument Description
xt The x component of the transform vector.
yt The y component of the transform vector.
zt The z component of the transform vector.


Returns: N/A


Description

As the name implies, this does not set an absolute translation value to the object, but rather adds the amount of the vector onto the current transform (unlike d3d_transform_set_translation which sets an absolute position).


Example:

var tex = background_get_texture(bck_Wall); d3d_transform_set_identity();
d3d_transform_add_translation(0, 200, 400);
d3d_draw_block(-50, -50, -50, 50, 50, 50, tex, 100, 100);
d3d_transform_set_identity();

The above code tells GameMaker: Studio to first go to (0,0,0) then add the translate vector (0,200,400) to the object in the game world, and then draw the block.


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