openGL_3 - 副本.docx

  1. 1、本文档共15页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
openGL_3 - 副本

实验三几何变换和光照班级:姓名:学号:3.1 实验类型综合型实验3.2 实验目的与要求1)掌握几何变换中的平移,旋转和缩放变换2)理解并掌握光照的基本使用方法3.3实验内容和步骤 1)制作一个机器人,运用前面所学的知识。//机器人程序2#define GLUT_DISABLE_ATEXIT_HACK #include stdlib.h#include GL/glut.h#define TORSO_HEIGHT 5.0#define UPPER_ARM_HEIGHT 2.0#define LOWER_ARM_HEIGHT 2.0#define UPPER_LEG_RADIUS 0.5#define LOWER_LEG_RADIUS 0.5#define LOWER_LEG_HEIGHT 2.0#define UPPER_LEG_HEIGHT 2.0#define UPPER_LEG_RADIUS 0.5#define TORSO_RADIUS 1.0#define UPPER_ARM_RADIUS 0.5#define LOWER_ARM_RADIUS 0.5#define HEAD_HEIGHT 1.5#define HEAD_RADIUS 1.0typedef float point[2];static GLfloat theta[11] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0, 180.0,0.0,180.0,0.0}; /* initial joint angles */static GLint angle = 2;GLUquadricObj *t, *h, *lua, *lla, *rua, *rla, *lll, *rll, *rul, *lul;double size=1.0;void torso(){ glPushMatrix(); glRotatef(-90.0, 1.0, 0.0, 0.0); gluCylinder(t,TORSO_RADIUS, TORSO_RADIUS, TORSO_HEIGHT,10,10); glPopMatrix();}void head(){ glPushMatrix(); glTranslatef(0.0, 0.5*HEAD_HEIGHT,0.0); glScalef(HEAD_RADIUS, HEAD_HEIGHT, HEAD_RADIUS); gluSphere(h,1.0,10,10); glPopMatrix();}void left_upper_arm(){ glPushMatrix(); glRotatef(-90.0, 1.0, 0.0, 0.0); gluCylinder(lua,UPPER_ARM_RADIUS, UPPER_ARM_RADIUS, UPPER_ARM_HEIGHT,10,10); glPopMatrix();}void left_lower_arm(){ glPushMatrix(); glRotatef(-90.0, 1.0, 0.0, 0.0); gluCylinder(lla,LOWER_ARM_RADIUS, LOWER_ARM_RADIUS, LOWER_ARM_HEIGHT,10,10); glPopMatrix();}void right_upper_arm(){ glPushMatrix(); glRotatef(-90.0, 1.0, 0.0, 0.0); gluCylinder(rua,UPPER_ARM_RADIUS, UPPER_ARM_RADIUS, UPPER_ARM_HEIGHT,10,10); glPopMatrix();}void right_lower_arm(){ glPushMatrix(); glRotatef(-90.0, 1.0, 0.0, 0.0); gluCylinder(rla,LOWER_ARM_RADIUS, LOWER_ARM_RADIUS, LOWER_ARM_HEIGHT,10,10); glPopMatrix();}void left_upper_leg(){ glPushMatrix(); glRotatef(-90.0, 1.0, 0.0, 0.0); gluCylinder(lul,UPPER_LEG_RADIUS, UPPER_LEG_RADIUS, UPPER_LEG_HEIGHT,10,10); glPopMatrix();}void left_lower_leg(){ glPushMatr

文档评论(0)

xcs88858 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档