91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 200KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-12
  • 語言: 其他
  • 標簽: opengl??機器人??

資源簡介

基于opengl的3D機器人,帶有光照陰暗效果,機器人可以行走,手、頭腳、肩膀都可以自由旋轉。

資源截圖

代碼片段和文件信息

#include
#include
#include
#include
#include
#include
using?namespace?std;
int?all_rotate=0;

int?head_rotate=0;

int?shoulder_y=0;
int?shoulder_x=0;

int?larm_r=0;
int?rarm_r=0;

int?llw=0;
int?rlw=0;
int?robot_move=0;
int?turn_back=0;

float?l=0;
float?k=0;


float?a=0.2b=0.9c=0.3d=0.3;???//a--torso??b--body??c--shoulder??d--arm?and?leg
void?torso()
{
glPushMatrix();
glScalef(float(1.0/a)1.01.0);
glutSolidSphere(a?30?17);??
glPopMatrix();
}
void?body()
{
glPushMatrix();
glTranslatef(01.50);??
glScalef(1.0float(1.5/b)1.0);
????glutSolidSphere(b?30?17);?
glPopMatrix();
}
void?shoulder()
{
glPushMatrix();
glScalef(float(1.5/c)1.01.0);
glutSolidSphere(c?30?17);?
glPopMatrix();
}
void?head()
{
glPushMatrix();
glTranslatef(00.50);??
glutSolidSphere(0.5f?30?17);
glTranslatef(000.5);??
glutSolidSphere(0.1f?30?17);
glPopMatrix();
}
void?upperarm()??????????????????????//手腳的畫法相同,所以直接使用同一個函數
{
glPushMatrix();
glTranslatef(0-10);?
glScalef(1.0float(1.0/d)1.0);
glutSolidSphere(d?30?17);
glPopMatrix();
}
void?lowerarm()
{
glPushMatrix();
glTranslatef(0-10);?
glScalef(1.0float(1.0/d)1.0);
glutSolidSphere(d?30?17);?
glPopMatrix();
}




void?init(void)
{
GLfloat?mat_diffuse[]={1.01.01.01.0};
GLfloat?mat_specular[]={1.01.01.01.0};
GLfloat?mat_shininess[]={50.0};
GLfloat?light_diffuse[]={0.10.90.11.0};
GLfloat?light_position[]={10.010.010.01.0};
GLfloat?light_specular[]={0.50.50.51.0};
GLfloat?lmodel_ambient[]={0.01.00.01.0};
glClearColor(0.00.00.00.0);
glShadeModel(GL_SMOOTH);
glMaterialfv(GL_FRONTGL_SPECULARmat_specular);
glMaterialfv(GL_FRONTGL_SHININESSmat_shininess);
glLightfv(GL_FRONTGL_DIFFUSEmat_diffuse);
glLightfv(GL_LIGHT0GL_POSITIONlight_position);
glLightfv(GL_LIGHT0GL_DIFFUSElight_diffuse);
glLightfv(GL_LIGHT0GL_SPECULARlight_specular);
glLightModelfv(GL_LIGHT_MODEL_AMBIENTlmodel_ambient);
GLfloat?mat_ambient[]={1.01.01.01.0};
GLfloat?light_ambient[]={1.01.01.01.0};

glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
}
void?display(void)
{
glClearColor(0.00.00.00.0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glColor3f(0.10.90.1);


glPushMatrix();

glRotatef((float)all_rotate0.01.00.0);

glPushMatrix();

glTranslatef(00robot_move);

glPushMatrix();
body();?????????????????//身體
glPopMatrix();

glPushMatrix(); //(000)

glTranslatef(030);????//(030)

glPushMatrix();?????????//先畫頭,這樣頭和脖子就不會一起旋轉
glRotatef(head_rotate0.01.00.0);
head();
glPopMatrix(); //(030)

glRotatef((GLfloat)shoulder_y0.01.00.0);?????//shoulder、arms?rotate?based?on?Y?axis
glRotatef((GLfloat)shoulder_x1.00.00.0); //shoulder、arms?rotate?based?on?X?axis


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-03-09?18:57??Robot\
?????目錄???????????0??2017-03-09?18:57??Robot\Robot\
?????文件?????????882??2017-01-03?12:56??Robot\Robot.sln
?????文件????????9216??2017-03-09?18:57??Robot\Robot.suo
?????目錄???????????0??2017-03-09?18:57??Robot\Robot\Debug\
?????文件?????????610??2017-03-09?18:55??Robot\Robot\Debug\cl.command.1.tlog
?????文件???????19180??2017-03-09?18:55??Robot\Robot\Debug\CL.read.1.tlog
?????文件?????????274??2017-03-09?18:55??Robot\Robot\Debug\CL.write.1.tlog
?????文件???????????2??2017-03-09?18:56??Robot\Robot\Debug\link-cvtres.read.1.tlog
?????文件???????????2??2017-03-09?18:56??Robot\Robot\Debug\link-cvtres.write.1.tlog
?????文件???????????2??2017-03-09?18:56??Robot\Robot\Debug\link.14240-cvtres.read.1.tlog
?????文件???????????2??2017-03-09?18:56??Robot\Robot\Debug\link.14240-cvtres.write.1.tlog
?????文件???????????2??2017-03-09?18:56??Robot\Robot\Debug\link.14240.read.1.tlog
?????文件???????????2??2017-03-09?18:56??Robot\Robot\Debug\link.14240.write.1.tlog
?????文件????????1356??2017-03-09?18:56??Robot\Robot\Debug\link.command.1.tlog
?????文件????????3538??2017-03-09?18:56??Robot\Robot\Debug\link.read.1.tlog
?????文件?????????612??2017-03-09?18:56??Robot\Robot\Debug\link.write.1.tlog
?????文件?????????350??2017-03-09?18:56??Robot\Robot\Debug\mt.command.1.tlog
?????文件?????????266??2017-03-09?18:56??Robot\Robot\Debug\mt.read.1.tlog
?????文件?????????266??2017-03-09?18:56??Robot\Robot\Debug\mt.write.1.tlog
?????文件?????????464??2017-03-09?18:55??Robot\Robot\Debug\rc.command.1.tlog
?????文件?????????238??2017-03-09?18:55??Robot\Robot\Debug\rc.read.1.tlog
?????文件?????????246??2017-03-09?18:55??Robot\Robot\Debug\rc.write.1.tlog
?????文件?????????406??2017-03-09?18:55??Robot\Robot\Debug\Robot.exe.embed.manifest
?????文件?????????472??2017-03-09?18:55??Robot\Robot\Debug\Robot.exe.embed.manifest.res
?????文件?????????381??2017-03-09?18:56??Robot\Robot\Debug\Robot.exe.intermediate.manifest
?????文件??????????57??2017-03-09?18:56??Robot\Robot\Debug\Robot.lastbuildstate
?????文件????????1828??2017-03-09?18:56??Robot\Robot\Debug\Robot.log
?????文件???????69088??2017-03-09?18:55??Robot\Robot\Debug\robot.obj
?????文件?????????713??2017-03-09?18:55??Robot\Robot\Debug\Robot.vcxprojResolveAssemblyReference.cache
?????文件???????????0??2017-03-09?18:55??Robot\Robot\Debug\Robot.write.1.tlog
............此處省略7個文件信息

評論

共有 條評論