Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

understand the meaning of the terms discipline and grievance

Answered: 1 week ago