1 / 6

Deriving the rotation matrix:

Deriving the rotation matrix:. 1. Convert Cartesian coordinate (x,y) to polar coordinate:. 2. Rotate p to p’: ____ remain unchanged, while ____ is changed to ______. Then (x’,y’) becomes ( rcos( f+q) , _________ ). 3. Use trigonometry identity:.

elaine
Download Presentation

Deriving the rotation matrix:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Deriving the rotation matrix: 1. Convert Cartesian coordinate (x,y) to polar coordinate: 2. Rotate p to p’: ____ remain unchanged, while ____ is changed to ______. Then (x’,y’) becomes ( rcos(f+q), _________ ). 3. Use trigonometry identity:

  2. Given three coordinates in floats, write the codes that draw these three lines. p1 p2 glBegin (GL_LINES); glEnd(); p3 glBegin (GL_LINE_STRIP); glEnd(); glBegin (GL_LINE_LOOP); glEnd();

  3. Modelview Matrix Viewing Transform Model Transform world coordinates e n w o [-1,1]3 [R3 | R4] [R3 | R4] [R3 | R4] Fill in the missing words, and circle the correct dimension With the following settings, determine the coordinates in each stage: O____ coordinates: ( ). W____ coordinates: ( ). E____ coordinates: ( ). N____ coordinates: ( ).

  4. Explain the components of Phong illumination model: What they are, and how they are computed Ambient: Explain these unit vectors: p: a point on surface Diffuse: n: v: Specular: r: l: • In OpenGL, these vectors are computed in eye coordinate space. • The code to the right declares the vertex (p) and normal (n) in object space. • To convert p to eye space: • To convert n to eye space: • To obtain l vector (for point light) • To obtain v vector:

  5. Design three macros (using #define) that return the largest of the given elements: Max2(x,y). Test if you get 4 with Max2 (1+2, 4). • 2. Use Max2 to construct Max3(x,y,z) and Max4(x,y,z,t) 3. Write a summation to evaluate • 4. OpenGL 2D: • On XY plane, construct grid lines, [-10,10]2, spacing 1 • Left click to create a point, right click to stop construction (# of points < 10) • Control-left-lick to toggle rotation, around first point • Implement “snap to grid” in clicking (points are created on integer points) • 5. OpenGL 3D (viewer) • [configurations shown on white board[ • XZ grid: [-10,10]2, spacing 1, unlit • Gate (glut primitives, cyl+box) • Porsche (OBJ) moving in a circular path • Point light : move in a circular path by arrow keys

  6. Fogmode: 連連看: linear, exp, exp2, [functions], plots,…

More Related