M
Master Summoner
Guest
I have a cone model drawn in 3d at some arbitrary x,y,z. I want it to rotate to face a target at another arbitrary x,y,z coordinate.
In my game, +X is to the right, +Z is up, and +Y is forwards.
I use the rotation functions to rotate my cone:
d3d_transform_set_rotation_z(...)
d3d_transform_set_rotation_x(...)
d3d_transform_set_rotation_y(...)
But I am having trouble calculating the angles for rot_x, rot_y, and rot_z that will cause the cone to point to my target correctly.
Help would be greatly appreciated.
In my game, +X is to the right, +Z is up, and +Y is forwards.
I use the rotation functions to rotate my cone:
d3d_transform_set_rotation_z(...)
d3d_transform_set_rotation_x(...)
d3d_transform_set_rotation_y(...)
But I am having trouble calculating the angles for rot_x, rot_y, and rot_z that will cause the cone to point to my target correctly.
Help would be greatly appreciated.