{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab01 - CSE4431 Lab 1 Burton Ma Mon 16 Jan 2012 1...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE4431: Lab 1 Burton Ma Mon 16 Jan, 2012 1 Introduction In the first part of this lab you will modify a small GLUT program to retrieve the modelling transformation of the modelview transformation. This should be a useful review of simple OpenGL and GLUT programming. The second part of the lab introduces you to the glman tool used in the textbook. You will modify a fragment shader that applies a brick pattern to rendered geometry. 2 Retrieving the Modelling Transformation Recall that OpenGL maintains a modelview matrix that is used to transform every vertex sent down the rendering pipeline. The modelview matrix is the product of the viewing transformation and the modelling transformation: T modelview = T viewing * T model (1) The viewing transformation is (almost) always a rotation followed translation: T viewing = D viewing * R viewing (2) OpenGL allows you to query the state of the modelview matrix using code such as // Get the modelview matrix and store it in Tmodelview GLdouble Tmodelview[16]; glGetDoublev(GL_MODELVIEW_MATRIX, Tmodelview); If the viewing transformation is known, then the modelling transformation can be computed as: T model = T - 1 viewing * T modelview (3) = ( D viewing * R viewing ) - 1 * T modelview (4) = R - 1 viewing * D - 1 viewing * T modelview (5) = R T viewing * D - 1 viewing * T modelview (6) 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2.1 Lab Exercise 1 Run the program /cse/course/4431/labs/01/lab01.exe
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}