19 hours ago, yaboiryan said:The code is finally here!
glm::mat4 model; glm::mat4 gun; glm::mat4 map; glm::mat4 windowMat; glm::mat4 view = camera.GetViewMatrix( ); ... gun = glm::translate(gun, glm::vec3(camera.GetPosition().x, camera.GetPosition().y, camera.GetPosition().z)); //my attempt to make the gun work is with this line of code. I made the gun use the camera's view matrix because I thought it would work... gun = (gun * glm::inverse(view)); //I also have this as another way (I thought) I could get it to work gun = glm::lookAt(glm::vec3(camera.GetPosition().x, camera.GetPosition().y, camera.GetPosition().z), glm::vec3 (camera.GetPosition().x, camera.GetPosition().y, camera.GetPosition().z) + camera.GetFront(), camera.getUp()); //this is how I draw the gun gunModel.Draw(shader);
I kept trying, but it seemed that almost none of the code would work...
If needed, I can give you my model view shader.
Nice.. continue in dev
Dont forget to record a new videos for us follow