OpenGl构建基本的房子_第1页
OpenGl构建基本的房子_第2页
OpenGl构建基本的房子_第3页
OpenGl构建基本的房子_第4页
OpenGl构建基本的房子_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

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

文档简介

1、精品文档CategoryItemsMark allocat edGradeDemo (10 marks)(H) house - A house should be created and displayed.2(T) tree- At least one tree should be created and displayed2(S) Sun - the sun is a must object.2(E) extra environment object(s) - you can create any other extra object on the piece of land you ha

2、ve.2(V) viewpoints - your program should enable viewer to view your home with different angles.2Sub-total:10Final Report (20 marks)(C) clarity - Does your report explain everything that you did?2(D) design - Did you design your implementation well? Did you use any CG technique(s) where appropriate?2

3、(E) English - Are there any spelling or grammatical errors? Is your writing clear and succinct?2(N) neatness - Are the text, code and figures laid out well? Is your writing/printing legible?2(T) thoroughness - Is the report complete? Did you leave important things out? Did you forget to describe imp

4、ortant cases, rules, or program behaviour? Did you make errors in your project that aren't listed in the shortcomings?2Sub-total:10Total:out of 20General Comments:1欢迎下载精品文档Introduction and Motivation :我们的实验包括房子、栅栏、小狗住的房子、树木、 机器人、太阳、草地等几个简单的事物,保证了能够从各个角 度观看到,完成了对项目的基本要求。在实验创建中,我们首先按照要求构思由整体的框架, 需

5、要做哪些事物,以及每个事物的大体位置,接着计算各个点 的坐标,之后分工进行,每个人做一到两个事物,最后将所有 事物整合在一起。还遇到的一个问题是,保证所有物体能够合理的展现 由来,不由现掩盖或不能显示效果的现象,这首先是对物体的 创建和坐标的把握,然后是对基本变换功能的掌握,对于这方 面的设计,不仅需要严谨计算还要学习功能的设计。Design and Implementations :一开始大体的想法是设计一个带有烟囱的尖顶房子, 后来在做房顶的时候遇到了困难,房顶的两侧无法显示,后来 找到的改进方法是将房顶做成一个长方体,并将长方体上的两 个点合并,并缩短 X轴上的距离,加上深度测试,最终由

6、现了 想要的效果;之后用类似的方法做由了树和小狗住的房子;太 阳一开始想用实验三的方法通过圆去做,后来效果不理想,我 们组在网上找到了glutSolidSphere();画球的方法。由此也学会了glutSolidCube(); 画立方体的方法,利用这种方法做生了栅栏,然后 两者综合做由了机器人Shortcomings :设计完实验作业,我们存在着很多的不足,首先,构 图坐标有些繁杂冗长,导致代码的篇幅有些长。第二,因为功 底是在太差,没有做由贴图和光源,导致整体不是很漂亮。第2欢迎下载精品文档三,实验思路有些混乱,经常是想起来什么就做什么,导致效 率变低。Conclusions :总体来说,能

7、够把项目做到这样的效果,我们还是很 满意的,但是还是对没有将四面的背景分别设定表达感到遗 憾。如果要重新做一遍,我会选择学习并使用纹理的表 现,这个功能的优点是能够使事物表现更为逼真。这门课程让我对 CG 这门学科有了最基本的认识和学 习,希望以后有机会可以多加接触。Appendix :#include<GL/glew.h>#include<GL/glut.h>#include<GL/gl.h>#include<iostream> using std:cout; | #define _USE_MATH_DEFINES#include <ma

8、th.h>double rotate_y = -15;/定义键盘才S制旋转 X轴,默认-5度double rotate_x = -15; /定义键盘制旋转 丫轴,默认0度GLfloat w = 800;GLfloat h = 600;GLfloat anglePyramid = 0.0f;GLfloat angleCube = 0.0f;void display(void)(glClear(GL_COLOR_BUFFER_BIT | GL DEPTH BUFFER BIT);glMatrixMode(GL_MODELVIEW);glLoadIdentity();glTranslatef(

9、0.0f, -100.0f, 0.0f);/ (左,上,前)glScalef(100, 100, 100);/放大图像(也可以更改点的数据来达到此效果)/Rotate 语句:(旋转度数,X, 丫,Z)/延X, Y, Z轴旋转/太阳(不能动)厂glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(-5.0, 5.0, 5.0);glutSolidSphere(1.5, 20, 20);glPopMatrix();3欢迎下载精品文档glRotatef(rotate_x, 1.0, 0.0, 0.0);glRotatef(rotate_y, 0.0

10、, 1.0, 0.0);/*/太阳(可以动)|glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(-5.0, 5.0, 5.0);glutSolidSphere(1.5, 20, 20);glPopMatrix();*/房子的两部分公用一个坐标系,屏幕远向近为Z轴,由下向上是丫轴,由左向右是X轴/*房顶*/顶glBegin(GL_QUADS);|glColor3f(0.0f, 0.0f, 0.502f);glVertex3f(2.05f, 3.5f, 0.0f);glVertex3f(-2.05f, 3.5f, 0.0f);glVertex

11、3f(-2.05f, 3.5f, 0.0f);glVertex3f(2.05f, 3.5f, 0.0f);/底glColor3f(0.0f, 0.0f, 0.502f);glVertex3f(3.5f, 1.5f, 2.5f);glVertex3f(-3.5f, 1.5f, 2.5f);glVertex3f(-3.5f, 1.5f, -2.5f);glVertex3f(3.5f, 1.5f, -2.5f);/前glColor3f(0.0f, 0.0f, 0.502f);glVertex3f(2.05f, 3.5f, 0.0f);glVertex3f(-2.05f, 3.5f, 0.0f);gl

12、Vertex3f(-3.5f, 1.5f, 2.5f);glVertex3f(3.5f, 1.5f, 2.5f);/后glColor3f(0.0f, 0.0f, 0.502f);glVertex3f(3.5f, 1.5f, -2.5f);glVertex3f(-3.5f, 1.5f, -2.5f);glVertex3f(-2.05f, 3.5f, 0.0f); glVertex3f(2.05f, 3.5f, 0.0f); /左glColor3f(0.0f, 0.0f, 0.502f); glVertex3f(-2.05f, 3.5f, 0.0f); glVertex3f(-2.05f, 3.5

13、f, 0.0f); glVertex3f(-3.5f, 1.5f, -2.5f); glVertex3f(-3.5f, 1.5f, 2.5f); /右glColor3f(0.0f, 0.0f, 0.502f); glVertex3f(2.05f, 3.5f, 0.0f); glVertex3f(2.05f, 3.5f, 0.0f); glVertex3f(3.5f, 1.5f, 2.5f); glVertex3f(3.5f, 1.5f, -2.5f); glEnd();/*烟囱*/4欢迎下载精品文档/顶glBegin(GL_QUADS);glColor3f(0.502f, 0.0f, 0.0f

14、);glVertex3f(3.0f, 4.0f, -1.0f);glVertex3f(2.0f, 4.0f, -1.0f);glVertex3f(2.0f, 4.0f, 1.0f);glVertex3f(3.0f, 4.0f, 1.0f);/底glColor3f(0.502f, 0.0f, 0.0f);glVertex3f(3.0f, 2.0f, 1.0f);glVertex3f(2.0f, 2.0f, 1.0f);glVertex3f(2.0f, 2.0f, -1.0f);glVertex3f(3.0f, 2.0f, -1.0f);/前glColor3f(0.502f, 0.0f, 0.0f

15、);glVertex3f(3.0f, 4.0f, 1.0f);glVertex3f(2.0f, 4.0f, 1.0f);glVertex3f(2.0f, 2.0f, 1.0f);glVertex3f(3.0f, 2.0f, 1.0f);/后glColor3f(0.502f, 0.0f, 0.0f);glVertex3f(3.0f, 2.0f, -1.0f);glVertex3f(2.0f, 2.0f, -1.0f);glVertex3f(2.0f, 4.0f, -1.0f);glVertex3f(3.0f, 4.0f, -1.0f);/左glColor3f(0.502f, 0.0f, 0.0f

16、);glVertex3f(2.0f, 4.0f, 1.0f);glVertex3f(2.0f, 4.0f, -1.0f);glVertex3f(2.0f, 2.0f, -1.0f);glVertex3f(2.0f, 2.0f, 1.0f);/右glColor3f(0.502f, 0.0f, 0.0f);glVertex3f(3.0f, 4.0f, -1.0f);glVertex3f(3.0f, 4.0f, 1.0f);glVertex3f(3.0f, 2.0f, 1.0f);glVertex3f(3.0f, 2.0f, -1.0f); glEnd();/*屋子*/顶glBegin(GL_QUA

17、DS);glColor3f(1.0f, 0.0f, 0.0f);glVertex3f(2.0f, 1.5f, -1.5f);glVertex3f(-2.0f, 1.5f, -1.5f);glVertex3f(-2.0f, 1.5f, 1.5f);glVertex3f(2.0f, 1.5f, 1.5f);/底glColor3f(1.0f, 0.0f, 0.0f);glVertex3f(2.0f, -0.5f, 1.5f);glVertex3f(-2.0f, -0.5f, 1.5f);glVertex3f(-2.0f, -0.5f, -1.5f);glVertex3f(2.0f, -0.5f, -

18、1.5f);5欢迎下载精品文档/门glCo or3f(0.0f, 0.0f, 1.0f);- glVertex3f(0.5, 1.0, -1.51); glVertex3f(-0.5, 1.0, -1.51); glVertex3f(-0.5, -0.5, -1.51); glVertex3f(0.5, -0.5, -1.51);/窗户|glColor3f(0.502f, 0.0f, 0.502f); glVertex3f(1.25, 1.25, -1.51); glVertex3f(0.75, 1.25, -1.51); glVertex3f(0.75, 0.75, -1.51); glVe

19、rtex3f(1.25, 0.75, -1.51);/前glColor3f(1.0f, 0.0f, 0.0f);glVertex3f(2.0f, 1.5f, 1.5f);glVertex3f(-2.0f, 1.5f, 1.5f);glVertex3f(-2.0f, -0.5f, 1.5f);glVertex3f(2.0f, -0.5f, 1.5f);/后glColor3f(1.0f, 0.0f, 0.0f);glVertex3f(2.0f, -0.5f, -1.5f);glVertex3f(-2.0f, -0.5f, -1.5f);glVertex3f(-2.0f, 1.5f, -1.5f);

20、glVertex3f(2.0f, 1.5f, -1.5f);/窗户glColor3f(0.502f, 0.0f, 0.502f); glVertex3f(-2.01, 1.05, 0.4);glVertex3f(-2.01, 1.05, -0.4);glVertex3f(-2.01,0.25, -0.4);glVertex3f(-2.01,0.25, 0.4);/左glColor3f(1.0f, 0.0f, 0.0f);glVertex3f(-2.0f, 1.5f, 1.5f);glVertex3f(-2.0f, 1.5f, -1.5f);glVertex3f(-2.0f, -0.5f, -1

21、.5f);glVertex3f(-2.0f, -0.5f, 1.5f);/窗户glColor3f(0.502f, 0.0f, 0.502f);glVertex3f(2.01, 1.05, 0.4);glVertex3f(2.01, 1.05, -0.4);glVertex3f(2.01, 0.25, -0.4);glVertex3f(2.01, 0.25, 0.4);/右glColor3f(1.0f, 0.0f, 0.0f);glVertex3f(2.0f, 1.5f, -1.5f);glVertex3f(2.0f, 1.5f, 1.5f);glVertex3f(2.0f, -0.5f, 1.

22、5f);glVertex3f(2.0f, -0.5f, -1.5f); glEnd();/*基座*/顶glBegin(GL_QUADS);6欢迎下载精品文档glColor3f(0.502f, 0.502f, 0.502f);glVertex3f(5.0, -0.5, -3.5);glVertex3f(-5.0, -0.5, -3.5);glVertex3f(-5.0, -0.5, 3.5);glVertex3f(5.0, -0.5, 3.5);/底glColor3f(0.502f, 0.502f, 0.502f);glVertex3f(5.0, -1.0, 3.5);glVertex3f(-5

23、.0, -1.0, 3.5);glVertex3f(-5.0, -1.0, -3.5);glVertex3f(5.0, -1.0, -3.5);/前glColor3f(0.502f, 0.502f, 0.502f);glVertex3f(5.0, -0.5, 3.5);glVertex3f(-5.0, -0.5, 3.5);glVertex3f(-5.0, -1.0, 3.5);glVertex3f(5.0, -1.0, 3.5);/后glColor3f(0.502f, 0.502f, 0.502f);glVertex3f(5.0, -1.0, -3.5);glVertex3f(-5.0, -

24、1.0, -3.5);glVertex3f(-5.0, -0.5, -3.5);glVertex3f(5.0, -0.5, -3.5);/左glColor3f(0.502f, 0.502f, 0.502f);glVertex3f(-5.0, -0.5, 3.5);glVertex3f(-5.0, -0.5, -3.5);glVertex3f(-5.0, -1.0, -3.5);glVertex3f(-5.0, -1.0, 3.5);/右glColor3f(0.502f, 0.502f, 0.502f);glVertex3f(5.0, -0.5, -3.5);glVertex3f(5.0, -0

25、.5, 3.5);glVertex3f(5.0, -1.0, 3.5);glVertex3f(5.0, -1.0, -3.5);glEnd();/*地板*/glBegin(GL_QUADS);glColor3f(0.0f, 0.502f, 0.0f);glVertex3f(100.0, -1.0, -100.0);glVertex3f(-100.0, -1.0, -100.0);glVertex3f(-100.0, -1.0, 100.0);glVertex3f(100.0, -1.0, 100.0);glEnd();/*狗窝*/ 1glBegin(GL_TRIANGLE_FAN) glCol

26、or3f(0.502f, 0.0f, 0.502f); glVertex3f(9.0f, 1.5f, -5.0f); glColor3f(0.502f, 0.0f, 0.502f); glVertex3f(10.0f, 0.5f, -5.5f); glColor3f(0.502f, 0.0f, 0.502f);7欢迎下载精品文档glVertex3f(8.0f, 0.5f, -5.5f); glColor3f(0.502f, 0.0f, 0.502f); glVertex3f(8.0f, 0.5f, -4.5f);glColor3f(0.502f, 0.0f, 0.502f);glVertex3

27、f(10.0f, 0.5f, -4.5f); glColor3f(0.502f, 0.0f, 0.502f); glVertex3f(10.0f, 0.5f, -5.5f); glEnd();glBegin(GL_QUADS);glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(9.5f, 0.5f, -4.5f);glVertex3f(8.5f, 0.5f, -4.5f);glVertex3f(8.5f, 0.5f, -5.5f);glVertex3f(9.5f, 0.5f, -5.5f);/底glColor3f(0.0f, 0.502f, 0.502f);

28、glVertex3f(9.5f, -1.0f, -5.5f);glVertex3f(8.5f, -1.0f, -5.5f);glVertex3f(8.5f, -1.0f, -4.5f);glVertex3f(9.5f, -1.0f, -4.5f);/前glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(9.5f, 0.5f, -5.5f);glVertex3f(8.5f, 0.5f, -5.5f);glVertex3f(8.5f, -1.0f, -5.5f);glVertex3f(9.5f, -1.0f, -5.5f);/后glColor3f(0.0f, 0.

29、502f, 0.502f);glVertex3f(9.5f, -1.0f, -4.5f);glVertex3f(8.5f, -1.0f, -4.5f);glVertex3f(8.5f, 0.5f, -4.5f);glVertex3f(9.5f, 0.5f, -4.5f);/小门glColor3f(0.502f, 0.0f, 0.502f);glVertex3f(8.49, 0.0, -5.0);glVertex3f(8.49, 0.0, -5.5);glVertex3f(8.49, -1.0, -5.5);glVertex3f(8.49, -1.0, -5.0);/左glColor3f(0.0

30、f, 0.502f, 0.502f);glVertex3f(8.5f, 0.5f, -5.5f);glVertex3f(8.5f, 0.5f, -5.0f);glVertex3f(8.5f, -1.0f, -5.0f);glVertex3f(8.5f, -1.0f, -5.5f);/右glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(9.50f, 0.5f, -5.0f);glVertex3f(9.50f, 0.5f, -5.5f);glVertex3f(9.50f, -1.0f, -5.5f);glVertex3f(9.50f, -1.0f, -5.0f)

31、; glEnd();8欢迎下载精品文档/* 树*/glBegin(GL_TRIANGLE_FAN);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-9.0f, 4.0f, 5.0f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-10.5f, 2.5f, 6.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-7.5f, 2.5f, 6.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-7.5f, 2.5f, 3.5f);glColor3f(0.0f, 1

32、.0f, 0.0f);glVertex3f(-10.5f, 2.5f, 3.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-10.5f, 2.5f, 6.5f);glEnd();glBegin(GL_TRIANGLE_FAN);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-9.0f, 5.5f, 5.0f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-10.5f, 4.0f, 6.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-7.5f, 4.0

33、f, 6.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-7.5f, 4.0f, 3.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-10.5f, 4.0f, 3.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-10.5f, 4.0f, 6.5f);glEnd();glBegin(GL_TRIANGLE_FAN);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-9.0f, 2.5f, 5.0f);glColor3f(0.0f, 1.0f, 0.

34、0f);glVertex3f(-10.5f, 1.0f, 6.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-7.5f, 1.0f, 6.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-7.5f, 1.0f, 3.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-10.5f, 1.0f, 3.5f);glColor3f(0.0f, 1.0f, 0.0f);glVertex3f(-10.5f, 1.0f, 6.5f);glEnd();9欢迎下载精品文档/顶glBegin(GL_Q

35、UADS);glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(-9.25f, 1.5f, 4.75f);glVertex3f(-8.75f, 1.5f, 4.75f);glVertex3f(-8.0f, 1.5f, 5.25f);glVertex3f(-9.25f, 1.5f, 5.25f);/底glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(-9.25f, -1.0f, 5.25f);glVertex3f(-8.75f, -1.0f, 5.25f);glVertex3f(-8.75f, -1.0f, 4.75f);gl

36、Vertex3f(-9.25f, -1.0f, 4.75f);/前glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(-9.25f, 1.5f, 5.25f);glVertex3f(-8.75f, 1.5f, 5.25f);glVertex3f(-8.75f, -1.0f, 5.25f);glVertex3f(-9.25f, -1.0f, 5.25f);/后glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(-9.25f, -1.0f, 4.75f);glVertex3f(-8.75f, -1.0f, 4.75f);glVer

37、tex3f(-8.75f, 1.5f, 4.75f);glVertex3f(-9.25f, 1.5f, 4.75f);/左glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(-8.75f, 1.5f, 5.25f);glVertex3f(-8.75f, 1.5f, 4.75f);glVertex3f(-8.75f, -1.0f, 4.75f);glVertex3f(-8.75f, -1.0f, 5.25f);/右glColor3f(0.0f, 0.502f, 0.502f);glVertex3f(-9.25f, 1.5f, 4.75f);glVertex3f(

38、-9.25f, 1.5f, 5.25f);glVertex3f(-9.25f, -1.0f, 5.25f);glVertex3f(-9.25f, -1.0f, 4.75f);glEnd();/后方栅栏glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(0, 0.1,3.0);glScalef(100, 1, 1);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(0, -0.3, 3.0);glScalef(100, 1

39、, 1);glutSolidCube(0.1);10载精品文档glPopMatrix();/右面栅栏glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, 0.1, 0);glScalef(1, 1,60);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, -0.3, 0);glScalef(1, 1,60);glutSolidCube(0.1);glPopMatrix();/左边栅栏glColor3f(

40、1.0, 0,0, 0.0);glPushMatrix();glTranslatef(-4.5, 0.1,0);glScalef(1, 1,60);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(-4.5, -0,3, 0);glScalef(1, 1,60);glutSolidCube(0.1);glPopMatrix();/后方竖栅栏 glColor3f(1.0, 0,0, 0.0); glPushMatrix();glTranslatef(0, -0.5, 3.0)

41、; glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0); glPushMatrix();glTranslatef(-0.5, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0); glPushMatrix();glTranslatef(-1.0, -0,5, 3.0); glScalef(1, 15, 1);11w载精品文档glutSolidCube(0.1); g

42、lPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(-1.5, -0.5, 3.0); glScalef(1, 15, 1); glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0.0, 0.0); glPushMatrix();glTranslatef(-2.0, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix(

43、);glTranslatef(-2.5, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(-3.0, -0.5, 3.0); glScalef(1, 15, 1); glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(-3.5, -0.5, 3.0); glScalef(1, 15, 1);

44、glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(-4.0, -0.5, 3.0);glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(-4.5, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();123W 载精品文档glColor3f(

45、1.0, 0,0, 0.0); glPushMatrix();glTranslatef(0.5, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0); glPushMatrix();glTranslatef(1.0, -0,5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(1.5, -0,5

46、, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(2.0, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(2.5, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMa

47、trix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(3.0, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0); glPushMatrix();glTranslatef(3.5, -0.5, 3.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTran

48、slatef(4.0, -0,5, 3.0);1&w载精品文档glScalef(1, 15, 1); glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0.0, 0.0); glPushMatrix();glTranslatef(4.5, -0.5, 3.0);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();/右侧竖栅栏glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, 0);glScalef(1, 15, 1

49、);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, 0.5);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0.0, 0.0); glPushMatrix();glTranslatef(4.5, -0.5, 1.0); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0.0,

50、 0.0);glPushMatrix();glTranslatef(4.5, -0.5, 1.5);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, 2.0);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0.0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, 2.5); glScale

51、f(1, 15, 1);glutSolidCube(0.1);glPopMatrix();精品文档glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, -0,5, 3.0);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, -0.5);glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor

52、3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, -1.0);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, -1.5);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5,

53、 -2.0);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, -2.5);glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(4.5, -0.5, -3.0);glScalef(1, 15, 1);glutSolidCube(0.1);glPopMatri

54、x();/左侧竖栅栏glColor3f(1.0, 0,0, 0.0);glPushMatrix();15载精品文档glTranslatef(-4.5, -0,5, 0);glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(-4.5, -0,5, 0.5); glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix(

55、);glTranslatef(-4.5, -0,5, 1.0);glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0); glPushMatrix();glTranslatef(-4.5, -0,5, 1.5);glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(-4.5, -0,5, 2.0);glScalef(1, 15, 1);glutSolidCube(0.1); glPopMatrix();glColor3f(1.0, 0,0, 0.0); glPushMatrix();glTranslatef(-4.5, -0,5, 2.5);glScalef(1, 15, 1); glutSolidCube(0.1);glPopMatrix();glColor3f(1.0, 0,0, 0.0);glPushMatrix();glTranslatef(-4.5, -0,5, 3.0

温馨提示

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

评论

0/150

提交评论