3D (Solved) Rotating Dice in XYZ Simultaneously

L

Lintydude

Guest
Whenever I try to rotate my 3D dice object on x, y or z axis, it will only work on the z axis. Help?
Draw Code:
Code:
d3d_set_culling(false);

d3d_transform_set_rotation_x(xrot);
d3d_transform_set_rotation_y(yrot);
d3d_transform_set_rotation_z(zrot);

d3d_model_draw(dice1,xpos,ypos,zpos,background_get_texture(bckDiceWin));
d3d_model_draw(dice2,xpos,ypos,zpos,background_get_texture(bckDiceDraw));
d3d_model_draw(dice3,xpos,ypos,zpos,background_get_texture(bckDiceLose));

d3d_transform_set_identity();
d3d_set_culling(true);
 

TheSnidr

Heavy metal viking dentist
GMC Elder
The transform_set functions will reset the entire matrix to identity, and then add the specified transformation, effectively overwriting previous transformations. Try using the transform_add functions instead ;)
 
L

Lintydude

Guest
The transform_set functions will reset the entire matrix to identity, and then add the specified transformation, effectively overwriting previous transformations. Try using the transform_add functions instead ;)
Thank you very much! But now, it isn't centered properly...
Code:
d3d_set_culling(false);

d3d_transform_add_rotation_x(xrot);
d3d_transform_add_rotation_y(yrot);
d3d_transform_add_rotation_z(zrot);

d3d_transform_add_translation(xpos,ypos,zpos);

d3d_model_draw(dice1,0,0,0,background_get_texture(bckDiceWin));
d3d_model_draw(dice2,0,0,0,background_get_texture(bckDiceDraw));
d3d_model_draw(dice3,0,0,0,background_get_texture(bckDiceLose));

d3d_transform_set_identity();
d3d_set_culling(true);
 
Top