Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Geometric Transformations In many of the OpenGL programs we have used this semester, object rotation was implemented using the following lines of code in the

Geometric Transformations

In many of the OpenGL programs we have used this semester, object rotation was implemented using the following lines of code in the display callback:

glMatrixMode(GL_MODELVIEW);

glLoadIdentity();

glRotatef(xangle, 1.0, 0.0, 0.0); // rotate x

glRotatef(yangle, 0.0, 1.0, 0.0); // rotate y

glRotatef(zangle, 0.0, 0.0, 1.0); // rotate z

The parameters xangle, yangle, zangle are global variables that are initialized to zero. In the keyboard callback these global variables are incremented by 5 degrees when the user types X, Y, or Z and decremented by 5 degrees when the user types x, y, or z.

a) What will the three rotation angles be if the user types in XXXyyZxx?

X = 5 degrees Y = -10 degrees Z = 5 degrees

b) What would happen if the user input xxZyyXXX instead? Explain.

X = 5 degrees Y = -10 degrees Z = 5 degrees

The exact same amount of X,Y,Z,x,y,z values are typed in as in part a) so the output should be the same. Order should not matter.

c) Assuming there are no other changes to the GL_MODELVIEW matrix, what is the order in which the three rotation operations above are applied to polygon vertices.

d) In general, does the order of operation matter when applying a sequence of rotations?

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

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

8. Managers are not trained to be innovation leaders.

Answered: 1 week ago