Slide 1

Slide 1 text

jgs SER332 Introduction to Graphics and Game Development Lecture 25: Final Review Javier Gonzalez-Sanchez [email protected] PERALTA 230U Office Hours: By appointment

Slide 2

Slide 2 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 1 jgs Disclaimer These slides provide examples of common questions They are NOT comprehensive

Slide 3

Slide 3 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 2 jgs Viewports § Divide the screen in two vertical view ports § Or, add a second viewport to show the score of a game

Slide 4

Slide 4 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 3 jgs OpenGL § Write a short programming segment that draws the triangle fan shown below. You do not have to worry about setting projections, opening windows, setting the camera, transformations, …. Just the code to draw the triangle fan. Make sure triangles are in counterclockwise order (0,1) (-3,3) (-1,5) (1,4) (3,2)

Slide 5

Slide 5 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 4 jgs OpenGL glLoadIdentiy(); glTranslatef(10, 0, 0); glRotatef(45, 0, 0, 1); // draw a square from 0,0 to 10,10.

Slide 6

Slide 6 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 5 jgs Vector Programming § Given the arrays vec3f vertices[NUM_VERTICES]; // float vec3i indices[NUM_TRIANGLES]; // integer § Write a procedure that returns the per-face normal vector for a face with number index vec3 computeFaceNormal(int index) { }

Slide 7

Slide 7 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 6 jgs Vector Programming § Given the arrays vec3f vertices[NUM_VERTICES]; // float vec3i indices[NUM_TRIANGLES]; // integer § Write a procedure that returns the per-vertex normal vector for a vertex with number index vec3 computeVertexNormal(int index) { }

Slide 8

Slide 8 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 7 jgs Mesh Data Structure Define a mesh data structure able to store: § vertex/faces, § normals per face, and § texture coordinates. You worked with one like this in your project 4.

Slide 9

Slide 9 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 8 jgs Mesh Data Structure § Store values in the mesh data structure to define a right-angled triangle at coordinates [0, 0, 0]. Legs are aligned to axis X and Y, respectively. Its length is 50.

Slide 10

Slide 10 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 9 jgs Textures § Given the BMP image shown below. Store values in the mesh data structure to apply a texture to the triangle defined above and make it looks like shown in the second image below BMP file Model

Slide 11

Slide 11 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 10 jgs Textures § Create a display list for a cylinder using triangles with a texture as done in the previous question.

Slide 12

Slide 12 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 11 jgs Materials § Write the code to create a triangle that has the highest emissive values. It should be the brightest object in any scenario.

Slide 13

Slide 13 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 12 jgs Materials § Write the code to create a triangle and apply Emerald material

Slide 14

Slide 14 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 13 jgs Materials § Is the shininess value for chrome greater than or lower than rubber? __________________ § Are the diffuse constants for pearls greater than or lower than plastic (black)? __________ § Are the specular constants for metals greater than or lower than pearl? ________________

Slide 15

Slide 15 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 14 jgs Navigation § Make the camera move autonomously from point A to point B. Given that the method scenario() return a display list with the four buildings described below. Buildings are 100x100x100 units

Slide 16

Slide 16 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 15 jgs Display List § Create a display list for: spaceship, ufo, asteroid

Slide 17

Slide 17 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 16 jgs Animation § Move the spaceship using the keyboard § Move asteroids randomly § Move ufo around the screen

Slide 18

Slide 18 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 17 jgs OpenGL § What does OpenGL stand for? § What does GLU stand for? § What does GLUT stand for? § Give three OpenGL commands as example?

Slide 19

Slide 19 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 18 jgs Hardware Define the following terms: § refresh rate, § resolution, § frame buffer, § pixel, § aspect ratio, § depth of the frame buffer

Slide 20

Slide 20 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 19 jgs Linear Algebra § Given three vertices of a triangle (v1, v2, v3), how can you compute the normal vector for v2?

Slide 21

Slide 21 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 20 jgs Matrix § Add § Subtract § Dot Product § Cross Product § Multiply

Slide 22

Slide 22 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 21 jgs Fonts § Give one advantage and one disadvantage of a bitmap font. § Give one advantage and one disadvantage of an outline font.

Slide 23

Slide 23 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 22 jgs Frame Buffer How many bits does a frame buffer need for: § 1024 x 768 resolution § RGB values and alpha values and 8 bit z- buffer How many bytes does a frame buffer need for: § 1000 x 1000 resolution § RGBA values § Double buffering

Slide 24

Slide 24 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 23 jgs OpenGL § Write the glut command to request a display mode that has: double buffering and RGBA color values. § Write the glut command to request a display mode that has: single buffering and RGB color values

Slide 25

Slide 25 text

Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 24 jgs Projection § Camera Point (3,4,5) § Look at Point (6,3,2) § “up” vector (0,1,0)

Slide 26

Slide 26 text

jgs SER332 Introduction to Graphics Javier Gonzalez-Sanchez [email protected] Spring 2018 Disclaimer. These slides can only be used as study material for the class SER332 at ASU. They cannot be distributed or used for another purpose.