




已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
人机接口与计算机图形学大作业人机接口与计算机图形学大作业 课程名称 人机接口与计算机图形学 学院名称 计算机工程学院 专 业 计算机科学与技术 班 级 xxxxxxx 学 号 xxxxxxxx 姓 名 xxxxx 教师姓名 xxxxx 学 分 3 成 绩 2014 年 5 月 JIANGSU UNIVERSITY OF TECHNOLOGY 对任意三角形或平行四边形对任意轴对任意三角形或平行四边形对任意轴 y ax b 做对称 反射 变换 做对称 反射 变换 1 程序 include include include using namespace std void polygon void Middle Bresenham int int int int void move to zero b void axis of symmetry void positive rotate void reverse rotate void give change to x direction void recovery int ax 100000 ay 100000 cx 100000 cy 100000 int length 0 temp temp1 int max x min x int a b int main polygon move to zero b positive rotate give change to x direction reverse rotate recovery return 0 void recovery ofstream out d polygon symmetry6 txt out x for int i 0 i length i out ax i out ax i 1 out endl out y for int j 0 j length j out ay j b out ay j 1 b endl out plot x y endl out hold on endl out x1 for i temp i temp1 i out ax i out ax i 1 out endl out y1 for j temp j temp1 j out ay j b out ay j 1 b endl out plot x1 y1 endl out hold on endl out x2 for i 0 i length i out cx i out cx i 1 out endl out y2 for j 0 j length j out cy j out cy j 1 endl out plot x2 y2 endl void reverse rotate ofstream out d polygon symmetry5 txt out x int bx 100000 for int i 0 i length i bx i ax i ax i ax i cos atan a ay i sin atan a out ax i out ax i 1 out endl out y for int j 0 j length j ay j bx j sin atan a ay j cos atan a out ay j out ay j 1 endl out plot x y endl out hold on endl out x1 for i temp i temp1 i bx i ax i ax i ax i cos atan a ay i sin atan a out ax i out ax i 1 out endl out y1 for j temp j temp1 j ay j bx j sin atan a ay j cos atan a out ay j out ay j 1 endl out plot x1 y1 endl void give change to x direction ofstream out d polygon symmetry4 txt out x for int i 0 i length i out ax i out ax i 1 out endl out y for int j 0 j length j ay j ay j out ay j out ay j 1 endl out plot x y endl out hold on endl out x1 for i temp i temp1 i out ax i out ax i 1 out endl out y1 for j temp j temp1 j ay j ay j out ay j out ay j 1 endl out plot x1 y1 endl void positive rotate ofstream out d polygon symmetry3 txt out x int bx 100000 for int i 0 i length i bx i ax i ax i ax i cos atan a ay i sin atan a out ax i out ax i 1 out endl out y for int j 0 j length j ay j bx j sin atan a ay j cos atan a out ay j out ay j 1 endl out plot x y endl out hold on endl out x1 for i temp i temp1 i bx i ax i ax i ax i cos atan a ay i sin atan a out ax i out ax i 1 out endl out y1 for j temp j temp1 j ay j bx j sin atan a ay j cos atan a out ay j out ay j 1 endl out plot x1 y1 endl void move to zero b ofstream out d polygon symmetry2 txt out x for int i 0 i length i out ax i out ax i 1 out endl out y for int j 0 j length j ay j b out ay j out ay j 1 endl out plot x y endl out hold on endl out x1 for i temp i temp1 i out ax i out ax i 1 out endl out y1 for j temp j temp1 j ay j b out ay j out ay j 1 endl out plot x1 y1 endl void axis of symmetry cout 输入对称轴 y ax b 中 a 和 b 两个常数 a b min x 400 max x 400 Middle Bresenham min x a min x b max x a max x b void polygon int n cout 输入想要生成多边形的边数 n cout 按多边形的顺时针方向输入顶点坐标 point x point y tempx point x tempy point y max x min x point x for int i 1 i point x point y if point x max x max x point x if point x min x min x point x Middle Bresenham temp x temp y point x point y Middle Bresenham point x point y tempx tempy ofstream out d polygon symmetry1 txt out x for i 0 i length i cx i ax i out ax i out tempx out endl out y for int j 0 j length j cy j ay j out ay j out tempy endl out plot x y endl out hold on endl temp length axis of symmetry out x1 for i temp i length i out ax i out ax i 1 out endl out y1 for j temp j length j out ay j out ay j 1 endl out plot x1 y1 x1 1 1 int s2 y2 y1 1 1 bool interchange false if dy dx int temp dx dx dy dy temp interchange true int p 2 dy dx for int i 0 i 0 if interchange y s2 else x s1 p 2 dx if interchange x s1 else y s2 p 2 dy 2 步骤 A 输入一个平行四边形的四个坐标 100 150 250 400 750 400 600 150 B 用中点 Bresenham 算法 每两个点生成一条直线 C 输入要生成的多边形的边数 顶点坐标 任意轴的参数设定 a b 的取值 a b 的取值为 5 520 对 a b 数值的设定为
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB∕T 35770-2022《 合规管理体系 要求及使用指南》之4:“4组织环境-4.3确定合规管理体系的范围”专业深度解读和应用指导材料(雷泽佳编写2025D0)
- 2025年国企招聘图像题库及答案
- 2025年事业单位工勤技能考试题库(含答案)
- 测试三力考试题及答案
- 2025年善意的谎言辩论会资料
- 2025年山西省吕梁市事业单位工勤技能考试考试题库及参考答案
- 2025年孤岛野犬的题目及答案
- 新质生产力纺织业
- 市政桥梁施工方案
- 高职数学试卷及答案
- 2025年汽车转向系统行业需求分析及创新策略研究报告
- 2025年四川省成都市高新区事业单位招聘考试综合类面试真题模拟试卷
- GB/T 7251.10-2025低压成套开关设备和控制设备第10部分:规定成套设备的指南
- 七下期末人教版数学试卷
- 2025新疆巴音郭楞州和硕县面向社会招聘社区工作者7人笔试参考题库附答案解析
- 2025年六安市裕安区石婆店镇公开招考村级后备干部8名笔试备考试题及答案解析
- 2025年事业单位考试题库及参考答案
- 2025年公安机关人民警察(基本级)执法资格等级题库及答案
- 物流客服培训课件
- 人教版(2024)八年级上册英语Unit 2 Home Sweet Home教案
- 校园食堂食品安全知识培训课件
评论
0/150
提交评论