xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 400KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-29
  • 語言: 其他
  • 標簽: OpenGL??房子????月亮??

資源簡介

OpenGL編程實現繪制房子,樹,月亮,3D,可以進行旋轉

資源截圖

代碼片段和文件信息

#include?
#include
#include
#include
#include?
//---------------噴泉相關------------------------------------
struct?particle
{
??float?t;???????//?粒子的壽命
??float?v;???????//?粒子的運動速度
??float?d;???????//?粒子的運動方向
??float?x?y?z;?//?粒子的位置坐標
??float?xd?zd;??//?X?和?Z?方向上的增量
??char?type;?????//?粒子的狀態(移動或淡化)
??float?a;???????//?粒子淡化的?alpha?值
??struct?particle?*next?*prev;
};
struct?particle?*fn=NULL;???/*?Fountains?鏈表結構*/
int?timep=17;
//--------------------------------------------------------------------
float?flag=1.0;
GLfloat?theta=3.1415*0.2fai=3.1415*0.7;
GLfloat?P0X=120.0*sin(theta)*sin(fai)P0Y=120*cos(fai)P0Z=120.0*cos(theta)*sin(fai);

int?windowwwindowh;????????????????????//窗口的寬和高
static?GLuint?texName;??????????????????//紋理組的名稱
//依序為月亮、側面、地面
GLuint?drawwalllistmoonlistrooflisttreeliststoolliststartList;????????????????????//貼環境紋理的顯示列表
???GLUquadricObj?*qobj;
//------------------------------------------------------------

GLfloat?ctrlpoints[4][4][3];

GLfloat?texpts[2][2][2]?=?{{{0.7?0.7}?{0.7?1}}?
{{1?0.7}?{1?1}}};
//-----------------------噴泉相關-----------------------------
void?AddParticles()
{
??struct?particle?*tempp;
??int?i;
??
????for?(i=0;?i<15;?i++)
????{
??????tempp?=?(struct?particle?*)malloc(sizeof(struct?particle));
??????if?(fn)?fn->prev?=?tempp;
??????tempp->next?=?fn;
??????fn?=?tempp;
??
??????tempp->t?=?-9.9;
??????tempp->v?=?(float)(rand()?%?200000)/100000+1;?//?速度
??????tempp->d?=?(float)(rand()?%?400)/100-2;?????//?方向角度
??????//?開始運動的坐標
??????tempp->x?=?0;
??????tempp->y?=?0;
??????tempp->z?=?i*2;
??????tempp->xd?=?cos((tempp->d*3.14159)/180)*tempp->v/4;
??????tempp->zd?=?sin((tempp->d*3.14159)/180)*tempp->v;
??????tempp->type?=?0;?
??????tempp->a?=?1;?
}
}
//??移動粒子
void?MoveParticles()
{
??struct?particle?*tempp;

??{
????tempp?=?fn;?
????while?(tempp)
????{
??????if?(tempp->type?==?0)?//?如果粒子是運動的
??????{
????????tempp->x?+=?tempp->xd;
????????tempp->z?+=?tempp->zd;
????????tempp->y?=?-(9.8*(tempp->t*tempp->t/4))/2+122.5;?//?計算高度
????????tempp->t?+=?0.1;?//?壽命遞增
????????if?(tempp->y?type?=?1;?//?如果粒子落到地上,則粒子淡化
??????}
??????else?//?粒子落到地上
??????{
????????tempp->y?=?-(9.8*(tempp->t*tempp->t/4))/2+122.5;?
??????}
??????tempp?=?tempp->next;?//進行下一個粒子的計算
????}
??}
}
//??刪除粒子
void?DeleteParticles()
{
??struct?particle?*tempp?*temp1;

??{
????tempp?=?fn;
????while?(tempp)
????{
??????if?((tempp->type?==?1)?&&?(tempp->a?<=?0))?//?粒子死亡
??????{
????????//?刪除粒子
????????temp1?=?tempp->prev;
????????tempp->prev->next?=?tempp->next;
????????if?(tempp->next)?tempp->next->prev?=?temp1;
????????free(tempp);
????????tempp?=?temp1;
??????}
??????tempp?=?tempp->next;
????}
??}
}

void?timf(int?value)
{
??glutPostRedisplay();
??glutTimerFunc(timep?timf?0);
}
//-------------------------------------------------------------
void?readimage(char

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????196664??2005-06-12?17:52??source?code\door.bmp

?????文件?????196664??2005-06-13?00:05??source?code\floor.bmp

?????文件?????196664??2005-06-12?15:10??source?code\moon.bmp

?????文件??????20534??2005-06-18?23:05??source?code\Pond.cpp

?????文件??????49208??2005-06-12?16:34??source?code\roof.bmp

?????文件??????49208??2005-06-12?19:05??source?code\starlow.bmp

????..A.SH.?????21504??2005-06-18?23:06??source?code\Thumbs.db

?????文件?????227071??2007-04-11?16:16??月色.pdf

?????目錄??????????0??2005-06-18?23:06??source?code

-----------?---------??----------?-----??----

???????????????957735????????????????????10


評論

共有 條評論