Sets the transformation to a translation over the indicated vector.


d3d_transform_set_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


A translation transform will take the vertices used for drawing and simply set them to be drawn at whatever coordinates you want to them. The effect you get will effectively look like you took the object and simply moved it. The fundamental difference between this transform and d3d_transform_add_translation is that this will clear all transforms that have been previously done.


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

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

Back: 3D Drawing
Next: d3d_transform_set_scaling
© Copyright YoYo Games Ltd. 2015 All Rights Reserved