下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、计算机图形学实验报告裁剪算法实验姓名 闫学森 学号 3013216087 专业 计算机 班级 3班 天津大学计算机科学与技术学院2015年 12 月 1日一、实验目的实现sutherland-hodgman多边形裁剪算法二、实验内容自定义裁剪窗口和待裁剪直线段(或多边形),采用不同颜色突出显示裁剪结果三、实验结果四、实验分析和总结sutherland-hodgman多边形裁剪算法是将原多边形进行左右下上四次裁剪。其中进行两次分解 第一次分解:将多边形关于矩形窗口的裁剪分解为它关于窗口四条边所在直线的裁剪; 第二次分解:将多边形关于一条直线的裁剪分解为多边形各边关于该直线的裁剪。四次裁剪相似,只
2、要修改部分变量即可。但是第一次修改时没有完全改掉,出来的图像不正确。通过这次试验使我了解到如何运用计算机程序对窗口进行剪裁,了解到编码剪裁算法直观方便,速度较快,中点分割剪裁算法不用进行乘除运算,剪裁效率高, sutherland-hodgman直线裁剪算法更快。五、源代码/ polygonclipdemo.cpp : defines the class behaviors for the application./#include "stdafx.h"#include "polygonclipdemo.h"#include "mainfrm.
3、h"#ifdef _debug#define new debug_new#endif/ cpolygonclipdemoappbegin_message_map(cpolygonclipdemoapp, cwinapp)on_command(id_app_about, onappabout)end_message_map()/ cpolygonclipdemoapp constructioncpolygonclipdemoapp:cpolygonclipdemoapp()/ todo: add construction code here,/ place all significan
4、t initialization in initinstance/ the one and only cpolygonclipdemoapp objectcpolygonclipdemoapp theapp;/ cpolygonclipdemoapp initializationbool cpolygonclipdemoapp:initinstance()/ initcommoncontrols() is required on windows xp if an application/ manifest specifies use of comctl32.dll version 6 or l
5、ater to enable/ visual styles. otherwise, any window creation will fail.initcommoncontrols();cwinapp:initinstance();/ standard initialization/ if you are not using these features and wish to reduce the size/ of your final executable, you should remove from the following/ the specific initialization
6、routines you do not need/ change the registry key under which our settings are stored/ todo: you should modify this string to be something appropriate/ such as the name of your company or organizationsetregistrykey(_t("local appwizard-generated applications");/ to create the main window, t
7、his code creates a new frame window/ object and then sets it as the application's main window objectcmainframe* pframe = new cmainframe;m_pmainwnd = pframe;/ create and load the frame with its resourcespframe->loadframe(idr_mainframe,ws_overlappedwindow | fws_addtotitle, null,null);/ the one
8、and only window has been initialized, so show and update itpframe->showwindow(sw_show);pframe->updatewindow();/ call dragacceptfiles only if there's a suffix/ in an sdi app, this should occur after processshellcommandreturn true;/ cpolygonclipdemoapp message handlers/ caboutdlg dialog used
9、 for app aboutclass caboutdlg : public cdialogpublic:caboutdlg();/ dialog dataenum idd = idd_aboutbox ;protected:virtual void dodataexchange(cdataexchange* pdx); / ddx/ddv support/ implementationprotected:declare_message_map();caboutdlg:caboutdlg() : cdialog(caboutdlg:idd)void caboutdlg:dodataexchange(cdataexchange* pdx)cdialog:dodataexchange(pdx);begin_message_map(caboutdlg, cdialog)end_message_ma
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小学封闭学校管理制度内容(3篇)
- 坡道堵漏施工方案(3篇)
- 冰雪联欢活动策划方案(3篇)
- 幼师开年活动方案策划(3篇)
- 开学活动创意方案策划(3篇)
- 故宫跑步活动方案策划(3篇)
- 施工单位管理制度照片(3篇)
- 景区夜间值班管理制度范文(3篇)
- 村农房管控管理制度(3篇)
- 棉花娃娃活动策划方案(3篇)
- 2026年及未来5年市场数据中国汽车车身电子控制行业全景评估及投资规划建议报告
- 征信修复协议书
- 黑龙江省哈尔滨市五区2025-2026学年八年级(五四学制)上学期期中语文试题(含答案)
- 2026年宁夏贺兰工业园区管委会工作人员社会化公开招聘备考题库及参考答案详解1套
- 黄芪中药课件
- 幼儿园老师面试高分技巧
- 航空运输延误预警系统
- 运营总监2025年年底工作总结及2026年度工作计划
- 2026年管线钢市场调研报告
- 2025年江苏省公务员面试模拟题及答案
- 2025中国家庭品牌消费趋势报告-OTC药品篇-
评论
0/150
提交评论