Hello,
I have been working on this program, and I wanted to attach a gun, which will later be able to be fired.
I have the gun following the camera's position, but it will not rotate along with the camera.
Here is what I have so far:
Code :
gun = glm::translate(gun, glm::vec3(camera.GetPosition().x+ 0.15, camera.GetPosition().y - 0.1, camera.GetPosition().z -0.3));
GLfloat angle = -121.0;
gun = glm::rotate(gun, angle, glm::vec3(0.0f, 1.0f, 0.0f));
What should I add?
The rotate line is so I can get it positioned correctly and the translate is so I can see the gun in the camera.
I just want the gun to stay the way it is no matter how much I rotate the camera.
It does not move with the camera if I look left and right.
Thanks,
RYANISKOOL