…… … … … … … …名…姓… … … … … 密 … … 号…学… … 级… … … … 封 …业…专… … … … … … … 线 …院…学… … … … … … … ………… 山东大学 计算机图形学 课程试卷 A 09-10 学年 2 学期 (1) Assume that the vertices of the first triangle in the above rendering of a mesh are 样就避免了在计算每个点的光照时计算r向量,减少了计算量 given in clockwise order. Please draw the mesh in the following space where a, b, c, d, 改进的phong光照模型: e, and f are the mentioned vertices. I=1/(a+bd+c*d^2)(Kd*Ld*Max(l*n,0)+Ks*Ls*Max((h*n)^alpha,0))+Ka*La a b 3. Answer the following questions. (1) What is the purpose of projection normalization? c d (2) How does the graphics system perform the normalization for an orthogonal projection f defined by glOrtho(left, right, bottom, top, near, far)? Give the steps and the final projection matrix. e (1)投影归一化时将视体统一为长宽高都为2,中心在原点的标准视体,这样使得同 样的流水线即可对平行视体进行操作,也可对透视视体进行操作,使处理过程得到(2) Why do we often prefer triangle strips and/or triangle fans to a group of separate 统一。同时也简化了裁减过程。 triangles in representation of the same 3D object? (2)平移T(-(right+left)/2,-(top+bottom)/2,(far+near)/2) 伸缩S(2/(right-left),2/(top-bottom),2/(far-near)) 如果全部用三角形图元绘制的话会有许多点被重复绘制。比较而言。Triangle strips 正交投影矩阵变换Mortho 与triangle fans 可以减少代码执行的代价与数据传输的代价 计算可得最终投影矩阵为: 2/(right-left) 0 0 -(right+left)/(right-left) 0 2/(top-bottom) 0 -(bottom+top)/(top-bottom) 0 0 2/(near-far) (far+near)/(far-near) 2. Answer the following questions. 0 0 0 1 (1) Give the equation for the Phong lighting model and explain the meaning of each term in it. (2) Describe the improvement the modified Phong model makes and give the modified lighting equation accordingly. 4. Answer the following questions. (1) (1) Briefly introduce the Bresenham’s algorithm for line segment rasterization. I=1/(a+bd+c*d^2)(Kd*Ld*Max(l*n,0)+Ks*Ls*Max((r*v)^alpha,0))+Ka*La (2) What is the advantage of the Bresenham’s algorithm over the DDA algorithm? L:此点指向光源的向量 Ld,Ls,La:分别为漫反射,镜面反射,环境光的光强 n:此点的法向量 Kd,Ks,Ka:分别为漫反射,镜面反射,环境光的反射系数 (1)设斜率m有0 学院 专业 级 学号 姓名 山东大学 计算机图形学 课程试卷 A void lower_arm() { glPushMatrix(); glTranslatef(0.0, 0.5*LOWER_ARM_HEIGHT, 0.0); glScalef(LOWER_ARM_WIDTH,LOWER_ARM_HEIGHT,LOWER_ARM_WIDTH); glutSolidCube(1.0); // Cube-C glPopMatrix(); } void display(void) { GLfloat theta[] = {0.0, 45.0, 45.0}; glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glColor3f(1.0, 0.0, 0.0); glRotatef(theta[0], 0.0, 1.0, 0.0); base(); glColor3f(0.0, 1.0, 0.0); glTranslatef(0.0, BASE_HEIGHT, 0.0); glRotatef(theta[1], 0.0, 0.0, 1.0); lower_arm(); glColor3f(0.0, 0.0, 1.0); glTranslatef(0.0, LOWER_ARM_HEIGHT, 0.0); glRotatef(theta[2], 0.0, 0.0, 1.0); upper_arm(); glFlush(); glutSwapBuffers(); } 09-10 学年 2 学期 void main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(500, 500); glutCreateWindow(\"robot\"); glEnable(GL_DEPTH_TEST); glClearColor(1.0, 1.0, 1.0, 1.0); glutDisplayFunc(display); glutMainLoop(); } (1) What is the screen output of this program? Please illustrate with a picture. (2) If we can vary the values in the theta array freely, what spatial region can be reached by the tip of the upper arm? 一个中心点在 (0.0, 0.2, 0.0),半径为1的球体 (3) Write out the affine transformation matrix applied to each of Cube-A, Cube-B, and Cube-C. 对于Cube-A:Ry(0)*T(0,0.1,0)*S(0.2,0.2,0.2) 计算得为 0.2 0 0 0 0 0.2 0 0.1 0 0 0 2 0 0 0 1.0 第 页 共 页 第 4 页 共 4 页 …………山东大学 计算机图形学 课程试卷 A 09-10 学年 2 学期 … … … …名…姓… … … … … 密 … … 号…学… … 级… … … … 封 …业…专… … … … … … … 线 …院…学… … … … … … … ………… 对Cube-B:Ry(0)*T(0,0.2,0)R(z)(45)*T(0,0.5,0)*R(z)(45)*T(0,0.25,0)S(0.05,0.5,0.05) 计算得 0 -1/2 0 -(1+sqrt(2))/4 ½ 0 0 sqrt(2)/4+1/5 0 0 1/(20) 0 0 0 0 1 对于Cube-C:Ry(0)*T(0,0.2,0)*R(z)(45)*T(0,0.25,0)*S(0.05,0.5,0.05) 计算得 sqrt(2)/40 -sqrt(2)/40 0 -sqrt(2)/8 sqrt(2)/40 -sqrt(2)/40 0 sqrt(2)/8+1/5 0 0 1/20 0 0 0 0 1 第 页 共第 4 页 共 4 页页 因篇幅问题不能全部显示,请点此查看更多更全内容