Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am writng a program using openGL. When the camera is fixed, how to set the model matrix to make a cube rotate about its
I am writng a program using openGL. When the camera is fixed, how to set the model matrix to make a cube rotate about its Y-axis as well as move in the circle about Z-axis by using OpenGL Mathematics (GLM)? I tried to do
model =glm::rotate(glm::mat4(1.0f), (angle), glm::vec3(0.0, 0.0, 1.0))*glm::translate(glm::mat4(1.0f), glm::vec3(6.0, 0.0, 0.0))*glm::rotate(glm::mat4(1.0f), (angle), glm::vec3(0.0, 1.0, 0.0));
But it does not seem right when i render it? Does anyone know how to make it right?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started