• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

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