3D [Solved] Having issues with rotating an object...

Emilie_Blue

Member
Hi, I've been trying to make a little game in 3D.

Everything went well until I had to make a tank with the canon rotating according to the turret angle and the elevation angle.
When I try to modify the canon elevation , it does something wierd depending on the rotation of the turret.

If I only elevate the canon and removing the rotation angle of the turret , the elevation works perfectly fine but the canon doesn't point where the turret of the tank is facing...
I thought I could just do :

GML:
d3d_transform_add_rotation_z(direction-90)
d3d_transform_add_rotation_x(elevation)
d3d_transform_add_translation(x,y,27)
       
d3d_model_draw(_core.mod_mbt_gun,0,0,0,_core.tex_mbt_gun)

d3d_transform_set_identity();
screenshot100.png

How can I make the canon rotation and elevation work ? I'm having trouble understanding what's going...
 
Last edited:
Top