(完整)山东大学计算机图形学2010试卷A(含答案),推荐文档_第1页
(完整)山东大学计算机图形学2010试卷A(含答案),推荐文档_第2页
(完整)山东大学计算机图形学2010试卷A(含答案),推荐文档_第3页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、山东大学计算机图形学课程试卷 a09-10学年2学期题号一二三四五六七八九十总分总分人得分5. choose two opengl sentences from the follow four candidates to transform the camera from the original position to the destination position得分阅卷人part i. multiple choice questions (5 points each)1. in a synthetic camera model, which of the following is (a

2、re) correct?d a) the image plane is behind the center of projection (cop).b) specifications of the objects and the viewer are dependent.c) the image of an object is flipped relative to the object.d) the projectors meet at the center of projection (cop).2. give an order of the following phases accord

3、ing to the rendering pipeline _cebda a) fragment processorglmatrixmode(gl_modelview) glloadidentity(); a c a) gltranslatef(0.0, 0.0, -d); /d0b) gltranslatef(0.0, 0.0, d); /d0c) glrotatef(-90.0, 0.0, 1.0, 0.0);d) glrotatef(90.0, 0.0, 1.0, 0.0);(destnation postion)密封线 学院专业级学号姓名 b) clipperc) vertex pro

4、cessord) rasterizere) primitive assembler3. which phase (as listed above) does each of the following operations belong to? cto convert object representations from one coordinate system to another dto generate inside fragments for a polygon and calculate their colors bto determine which objects are w

5、ithin the view volume ato determine the color of the corresponding pixel in the frame buffer4. which of the following statements regarding affine transformations is(are) correct? abd a) two translations are commutative.b) two rotations about the same axis are commutative.c) a scaling and a rotation

6、are commutatived) a general rotation about an arbitrary line can be done with translations and rotations around the axes.6. local lighting computes the color or shade of each object independently. so it cant deal with situations such asacd a) some objects are blocked from the light.b) real time illu

7、mination.c) light can reflect from object to object.d) some objects might be translucent.得分阅卷人glbegin (gl_triangle_strip) glvertex3fv(a); glvertex3fv(b); glvertex3fv(c); glvertex3fv(d); glvertex3fv(e); glvertex3fv(b); glvertex3fv(f);glend ( );part ii free form questions (10 points each)1. given the

8、following code fragment:第页共页第 1页 共 4页山东大学计算机图形学课程试卷 a09-10学年2学期(1) assume that the vertices of the first triangle in the above rendering of a mesh are given in clockwise order. please draw the mesh in the following space where a, b, c, d, e, and f are the mentioned vertices.abcdfe(2) why do we often

9、 prefer triangle strips and/or triangle fans to a group of separate triangles in representation of the same 3d object?如果全部用三角形图元绘制的话会有许多点被重复绘制。比较而言。triangle strips与 triangle fans 可以减少代码执行的代价与数据传输的代价样就避免了在计算每个点的光照时计算r向量,减少了计算量改进的phong光照模型:i=1/(a+bd+c*d2)(kd*ld*max(l*n,0)+ks*ls*max(h*n)alpha,0)+ka*la3

10、. answer the following questions.(1) what is the purpose of projection normalization?(2) how does the graphics system perform the normalization for an orthogonal projection defined by glortho(left, right, bottom, top, near, far)? give the steps and the final projection matrix.(1) 投影归一化时将视体统一为长宽高都为 2

11、,中心在原点的标准视体,这样使得同样的流水线即可对平行视体进行操作,也可对透视视体进行操作,使处理过程得到统一。同时也简化了裁减过程。(2) 平移 t(-(right+left)/2,-(top+bottom)/2,(far+near)/2)伸缩 s(2/(right-left),2/(top-bottom),2/(far-near)正交投影矩阵变换 mortho计算可得最终投影矩阵为:2/(right-left)00-(right+left)/(right-left)02/(top-bottom)0-(bottom+top)/(top-bottom)002/(near-far)(far+ne

12、ar)/(far-near)2. answer the following questions.0001(1) give the equation for the phong lighting model and explain the meaning of each termin it.(2) describe the improvement the modified phong model makes and give the modifiedlighting equation accordingly. (1)i=1/(a+bd+c*d2)(kd*ld*max(l*n,0)+ks*ls*m

13、ax(r*v)alpha,0)+ka*lal:此点指向光源的向量 ld,ls,la:分别为漫反射,镜面反射,环境光的光强n:此点的法向量kd,ks,ka:分别为漫反射,镜面反射,环境光的反射系数r:此点的反射光方向的向量alpha:镜面反射的高光系数v:此点指向观察着的方向的向量d:聚光源的距离a,b,c:常数,使光照效果变化柔和1/(a+bd+c*d2):距离衰减因子(2)4. answer the following questions.(1) briefly introduce the bresenhams algorithm for line segment rasterization

14、.(2) what is the advantage of the bresenhams algorithm over the dda algorithm?(1) 设斜率 m 有 0m=1如果设直线在 x+1 处的纵坐标位置离上一个像素中心距离为 a,离下一个像素中心距离为 b,设 d=x(b-a)m=y/x由 d 的正负情况可以决定究竟画在哪个像素点,而 dk+1 的值可由 dk 递推得到有 dk+1=dk+2ydk02(y-x)其他第页共页因此只需在算第一个 d 时计算交点 b-a,其后就可进行递推运算密封线 学院专业级学号姓名 第 2页 共 4页山东大学计算机图形学课程试卷 a09-10

15、学年2学期(2) 避免了大量的浮点运算,减少了计算量,提高了效率;相对于未改进的 dda 算法也避免了绘制直线不连续的情况。5. given the following 2d scene with 6 objects (a, b, d, e, f and g), we have added 5 partitioning planes (a, b, c, d and e) to construct a binary space partitioning (bsp) tree. draw the bsp tree and explain how to use the bsp tree to ren

16、der the scene.得分阅卷人part iii. opengl application questions (20 points)1. the following code implements a robot arm. please read it and answer the questions at the end.#include #include #define base_height 0.2#define base_width 0.2#define lower_arm_height 0.5#define lower_arm_width 0.05#define upper_a

17、rm_height 0.5#define upper_arm_width 0.05void base()glpushmatrix();gltranslatef(0.0, 0.5*base_height, 0.0); glscalef(base_width, base_height, base_width);glutsolidcube(1.0);/ cube-aaglpopmatrix();bcgeda debf递归地判断视点和每一个树结点的位置关系,先画离视点远的一半空间,再画离视点较近的一半空间。所以,对于此例,顺序应该是 degabfvoid upper_arm()glpushmatrix

18、();gltranslatef(0.0, 0.5*upper_arm_height, 0.0); glscalef(upper_arm_width,upper_arm_height, upper_arm_width);glutsolidcube(1.0);/ cube-bglpopmatrix();第页共页封密封线 学院专业级学号姓名 第 3页 共 4页山东大学计算机图形学课程试卷 a09-10学年2学期void lower_arm()glpushmatrix();gltranslatef(0.0, 0.5*lower_arm_height, 0.0); glscalef(lower_arm_

19、width,lower_arm_height,lower_arm_width);glutsolidcube(1.0);/ cube-cglpopmatrix();void display(void)glfloat theta = 0.0, 45.0, 45.0; glclear(gl_color_buffer_bit|gl_depth_buffer_bit);glmatrixmode(gl_modelview); glloadidentity();void main(int argc, char *argv)glutinit(&argc, argv);glutinitdisplaymode(g

20、lut_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.glcolor3f(1.0, 0.0, 0.0);glrota

21、tef(theta0, 0.0, 1.0, 0.0); base();glcolor3f(0.0, 1.0, 0.0);gltranslatef(0.0, base_height, 0.0);glrotatef(theta1, 0.0, 0.0, 1.0); lower_arm();glcolor3f(0.0, 0.0, 1.0);gltranslatef(0.0, lower_arm_height, 0.0);glrotatef(theta2, 0.0, 0.0, 1.0); upper_arm();glflush(); glutswapbuffers();(2) if we can var

22、y 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.200000.200.100020001.0第 4页 共 4页 学院专业级学号姓名 山东大学计算机图形学课程试卷 a09-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/20-(1+sqrt(2)/400sqrt(2)/4+1/5001/(20)00001对于 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)/400-sqrt(2)/8s

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论