首页 课程资源 C/C++     /    华南理工大学计算机图形学实验

华南理工大学计算机图形学实验

上传者: z_y_r12138 | 上传时间:2021/5/20 14:17:55 | 文件大小:48.13MB | 文件类型:zip
华南理工大学计算机图形学实验
一、1.Pleasedownloadandinstalltheglutlibrary.2.WriteacompleteprogramusingthefollowingcodestodrawaSierpinskigasket.voidmyinit(){//attributesglClearColor(1.0,1.0,1.0,1.0);glColor3f(1.0,0.0,0.0);//setupviewingglMatrixMode(GL_PROJECTION);glLoadIdentity();gluOrtho2D(0.0,50.0,0.0,50.0);glMatrixMode(GL_MODELVIEW);}voiddisplay(){GLfloatvertices[3][3]={{0.0,0.0,0.0},{25.0,50.0,0.0},{50.0,0.0,0.0}};//anarbitrarytriangleintheplanez=0;GLfloatp[3]={7.5,5.0,0.0};//orsetanydesiredinitialpointwhichisinsidethetriangle;intj,k;intrand();glBegin(GL_POINTS);for(k=0;k<5000;k++){/*pickarandomvertexfrom0,1,2*/j=rand()%3;//computenewlocation;p[0]=(p[0]+vertices[j][0])/2;p[1]=(p[1]+vertices[j][1])/2;//displaynewpointglVertex3fv(p);}glEnd();glFlush();}#includevoidmain(intargc,char**argv){glutInit(&argc;,argv);glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);glutInitAWindowSize(500,500);glutInitWindowPosition(0,0);glutCreateWindow(“SimpleOpenGLExample”);glutDisplayFunc(display);myinit();glutMainLoop();}3.实现DDA和Bresenham画线算法(1)画10万以上随机生成的直线段,比较两个算法的平均时间.(2)分别把屏幕上的1*1,5*5,9*9像素当作直线段上的一个点,观察线段的走样情况.二、请写一个OpenGL(如果熟悉WebGL也可以用)程序完成如下任务(1)读入三维网格模型的obj文件;(2)用OpenGL函数glTranslatef()对模型模型进行平移,使得其重心位于原点;(3)用函数glLookAt()设置视点,并且要求试点绕模型一周,以便用透视投影观察各个侧面;(4)要求利用真实感绘制对模型进行渲染.(利用OpenGL函数设置光源,材质,计算好每个三角形的法向量后,利用OpenGL的glNormal函数给待绘制的三角形设置法向量).绘制的结果大概如下:三、本实验为综合实验,任务是利用光线跟踪算法进行Whitted全局光照计算,并对读入场景进行真实感绘制。
(特别提示:网上类似的projects可以参考,但不能照抄.如http://tobias.isenberg.cc/graphics/LabSessions/RaytracingProject,http://physbam.stanford.edu/links/ray_tracing/project_ray_tracing.htmlhttps://www.cs.utexas.edu/~fussell/courses/cs354/assignments/raytracing/handout.shtml)(1)参加对象:本实验针对所有选课同学,3-5人组成一个小组,共同实现;
非15级同学在组队方面有困难的话可与老师沟通.(2)实验结果提交:每人都要求提交一份.内容包括a.源程序;可执行代码;三维场景数据;同组的同学这部

文件下载

资源详情

[{"title":"(94个子文件48.13MB)华南理工大学计算机图形学实验","children":[{"title":"计算机图形学","children":[{"title":"一","children":[{"title":"作业1-画Sierpinskigasket","children":[{"title":"homework1","children":[{"title":".vs","children":[{"title":"homework1","children":[{"title":"v14","children":[{"title":".suo <span style='color:#111;'>25.50KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"homework1.VC.db <span style='color:#111;'>30.75MB</span>","children":null,"spread":false},{"title":"homework1","children":[{"title":"1.cpp <span style='color:#111;'>1.12KB</span>","children":null,"spread":false},{"title":"homework1.vcxproj.filters <span style='color:#111;'>942B</span>","children":null,"spread":false},{"title":"homework1.vcxproj <span style='color:#111;'>7.20KB</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"homework1.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'>1.75KB</span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'>22.16KB</span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'>1.87KB</span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'>440B</span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'>1.10KB</span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'>3.09KB</span>","children":null,"spread":false},{"title":"homework1.lastbuildstate <span style='color:#111;'>203B</span>","children":null,"spread":false}],"spread":true},{"title":"2.obj <span style='color:#111;'>52.85KB</span>","children":null,"spread":false},{"title":"vc140.pdb <span style='color:#111;'>348.00KB</span>","children":null,"spread":false},{"title":"1.obj <span style='color:#111;'>9.13KB</span>","children":null,"spread":false},{"title":"vc140.idb <span style='color:#111;'>427.00KB</span>","children":null,"spread":false},{"title":"3.obj <span style='color:#111;'>56.33KB</span>","children":null,"spread":false},{"title":"homework1.log <span style='color:#111;'>84B</span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"homework1.sln <span style='color:#111;'>1.28KB</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"homework1.ilk <span style='color:#111;'>313.37KB</span>","children":null,"spread":false},{"title":"homework1.pdb <span style='color:#111;'>580.00KB</span>","children":null,"spread":false},{"title":"homework1.exe <span style='color:#111;'>42.00KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"作业3-走样","children":[{"title":"homework3","children":[{"title":".vs","children":[{"title":"homework3","children":[{"title":"v14","children":[{"title":".suo <span style='color:#111;'>19.00KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"homework3","children":[{"title":"homework3.vcxproj.filters <span style='color:#111;'>942B</span>","children":null,"spread":false},{"title":"1.cpp <span style='color:#111;'>2.82KB</span>","children":null,"spread":false},{"title":"homework3.vcxproj <span style='color:#111;'>7.20KB</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"vc140.pdb <span style='color:#111;'>372.00KB</span>","children":null,"spread":false},{"title":"1.obj <span style='color:#111;'>45.05KB</span>","children":null,"spread":false},{"title":"vc140.idb <span style='color:#111;'>571.00KB</span>","children":null,"spread":false},{"title":"homework3.Build.CppClean.log <span style='color:#111;'>880B</span>","children":null,"spread":false},{"title":"homework3.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'>456B</span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'>19.79KB</span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'>638B</span>","children":null,"spread":false},{"title":"homework3.lastbuildstate <span style='color:#111;'>203B</span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'>440B</span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'>1.10KB</span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'>2.93KB</span>","children":null,"spread":false}],"spread":false},{"title":"homework3.log <span style='color:#111;'>1.08KB</span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"homework3.VC.db <span style='color:#111;'>31.06MB</span>","children":null,"spread":false},{"title":"homework3.sln <span style='color:#111;'>1.28KB</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"homework3.exe <span style='color:#111;'>40.00KB</span>","children":null,"spread":false},{"title":"homework3.pdb <span style='color:#111;'>908.00KB</span>","children":null,"spread":false},{"title":"homework3.ilk <span style='color:#111;'>429.34KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"作业2-画10万条线","children":[{"title":"homework2","children":[{"title":".vs","children":[{"title":"homework2","children":[{"title":"v14","children":[{"title":".suo <span style='color:#111;'>21.50KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"homework2","children":[{"title":"1.cpp <span style='color:#111;'>3.12KB</span>","children":null,"spread":false},{"title":"homework2.vcxproj.filters <span style='color:#111;'>942B</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"homework2.Build.CppClean.log <span style='color:#111;'>880B</span>","children":null,"spread":false},{"title":"vc140.pdb <span style='color:#111;'>372.00KB</span>","children":null,"spread":false},{"title":"homework2.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'>456B</span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'>19.87KB</span>","children":null,"spread":false},{"title":"homework2.lastbuildstate <span style='color:#111;'>203B</span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'>658B</span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'>440B</span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'>1.10KB</span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'>2.93KB</span>","children":null,"spread":false}],"spread":true},{"title":"homework2.log <span style='color:#111;'>1.24KB</span>","children":null,"spread":false},{"title":"1.obj <span style='color:#111;'>64.84KB</span>","children":null,"spread":false},{"title":"vc140.idb <span style='color:#111;'>563.00KB</span>","children":null,"spread":false}],"spread":true},{"title":"homework2.vcxproj <span style='color:#111;'>7.21KB</span>","children":null,"spread":false}],"spread":true},{"title":"homework2.sln <span style='color:#111;'>1.28KB</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"homework2.exe <span style='color:#111;'>51.00KB</span>","children":null,"spread":false},{"title":"homework2.ilk <span style='color:#111;'>402.61KB</span>","children":null,"spread":false},{"title":"homework2.pdb <span style='color:#111;'>932.00KB</span>","children":null,"spread":false}],"spread":true},{"title":"homework2.VC.db <span style='color:#111;'>31.38MB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"三","children":[{"title":"大作业-rayTracerR","children":[{"title":"Plane.h <span style='color:#111;'>1.09KB</span>","children":null,"spread":false},{"title":"Light.h <span style='color:#111;'>513B</span>","children":null,"spread":false},{"title":"Color.h <span style='color:#111;'>1.91KB</span>","children":null,"spread":false},{"title":"main.cpp <span style='color:#111;'>15.41KB</span>","children":null,"spread":false},{"title":"Source.h <span style='color:#111;'>244B</span>","children":null,"spread":false},{"title":"Ray.h <span style='color:#111;'>413B</span>","children":null,"spread":false},{"title":"Object.h <span style='color:#111;'>430B</span>","children":null,"spread":false},{"title":"Camera.h <span style='color:#111;'>677B</span>","children":null,"spread":false},{"title":"Vect.h <span style='color:#111;'>1.10KB</span>","children":null,"spread":false},{"title":"Sphere.h <span style='color:#111;'>2.38KB</span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"二","children":[{"title":"作业-obj","children":[{"title":"sourcecode","children":[{"title":".vs","children":[{"title":"test2","children":[{"title":"v14","children":[{"title":".suo <span style='color:#111;'>21.00KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"test2.VC.db <span style='color:#111;'>30.75MB</span>","children":null,"spread":false},{"title":"test2.sln <span style='color:#111;'>1.27KB</span>","children":null,"spread":false},{"title":"test2","children":[{"title":"main.cpp <span style='color:#111;'>5.55KB</span>","children":null,"spread":false},{"title":"test2.vcxproj <span style='color:#111;'>7.20KB</span>","children":null,"spread":false},{"title":"test2.vcxproj.filters <span style='color:#111;'>945B</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"vc140.pdb <span style='color:#111;'>572.00KB</span>","children":null,"spread":false},{"title":"main.obj <span style='color:#111;'>823.59KB</span>","children":null,"spread":false},{"title":"test2.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'>420B</span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'>19.89KB</span>","children":null,"spread":false},{"title":"test2.lastbuildstate <span style='color:#111;'>207B</span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'>626B</span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'>398B</span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'>1.06KB</span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'>2.92KB</span>","children":null,"spread":false}],"spread":false},{"title":"vc140.idb <span style='color:#111;'>627.00KB</span>","children":null,"spread":false},{"title":"test2.log <span style='color:#111;'>872B</span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Debug","children":[{"title":"test2.ilk <span style='color:#111;'>2.67MB</span>","children":null,"spread":false},{"title":"test2.pdb <span style='color:#111;'>3.88MB</span>","children":null,"spread":false},{"title":"test2.exe <span style='color:#111;'>191.50KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • mukes:
    还没用,先下载2018-12-28
  • mukes:
    还没用,先下载2018-12-28

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明