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

  • 大小: 2.67MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-11-11
  • 語言: C/C++
  • 標(biāo)簽: OpenGL??

資源簡介

C++利用OpenGL實現(xiàn)三維繪圖,包括詳細的代碼注釋

資源截圖

代碼片段和文件信息

#include?“windows.h“?
#include?“gl/gl.h“?
#include?“gl/glaux.h“?
#include?“gl/glu.h“?
#include?“math.h“?

void?myinit()?
{?
glClearColor(1100);?
GLfloat?ambient[]={0.50.50.50};?
glLightModelfv(GL_LIGHT_MODEL_AMBIENT?ambient);?
GLfloat?mat_ambient[]={0.8f0.8f0.8f1.0f};?
GLfloat?mat_diffuse[]={0.8f0.0f0.8f1.0f};?
GLfloat?mat_specular[]={1.0f0.0f1.0f1.0f};?
GLfloat?mat_shininess[]={50.0f};?
GLfloat?light_diffuse[]={0.0f0.0f0.5f1.0f};?
GLfloat?light_position[]={0.0f0.0f1.0f0.0f};?
glMaterialfv(GL_FRONT_AND_BACKGL_AMBIENTmat_ambient);?
glMaterialfv(GL_FRONT_AND_BACKGL_DIFFUSEmat_diffuse);?
glMaterialfv(GL_FRONT_AND_BACKGL_SPECULARmat_specular);?
glMaterialfv(GL_FRONT_AND_BACKGL_SHININESSmat_shininess);?
glLightfv(GL_LIGHT0?GL_DIFFUSE?light_diffuse);?
glLightfv(GL_LIGHT0GL_POSITION?light_position);?
glEnable(GL_LIGHTING);?
glEnable(GL_LIGHT0);?
glDepthFunc(GL_LESS);?
glEnable(GL_DEPTH_TEST);?
}?
void?CALLBACK?display()?
{?
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);?
auxSolidSphere(1.0);//繪制半徑為1.0的實體球?
glFlush();?//強制輸出圖像?
auxSwapBuffers();?//交換繪圖緩存?
_sleep(100);
}?
void?CALLBACK?Idledisplay()?
{?
//xy滿足x2+y2=0.01。這樣可以使物體沿該圓軌?//跡運動。?
static?float?x=-0.1f?y=0.0f;?
static?BOOL?mark=TRUE;?
static?float?step=0.01f;?
x+=step;?
if(x<=.1&&x>=-.1)
{ ?
if(step>0)?
y=(float)sqrt(0.01f?-?x?*?x);?
else?
y=-(float)sqrt(0.01f?-?x?*?x);?
glTranslatef(xy0);?
}?
else?
{?
step=0-step;?
}?
display();?
}?
void?CALLBACK?myReshape(GLsizei?wGLsizei?h)?
{?
glViewport(00wh);?
glMatrixMode(GL_PROJECTION);?
glLoadIdentity();?
if(w<=h)?
glOrtho(-3.53.5-3.5*(GLfloat)w/(GLfloat)h?3.5*(GLfloat)w/(GLfloat)h-1010);?
else?
glOrtho(-3.5*(GLfloat)w/(GLfloat)h3.5*?(GLfloat)w/(GLfloat)h-3.53.5-1010);?
glMatrixMode(GL_MODELVIEW);?
glLoadIdentity();?
}?
void?main()?
{?
auxInitDisplayMode(AUX_DOUBLE|AUX_RGBA);?
auxInitPosition(00400400);?
auxInitWindow(“?circle?“);?
myinit();?
auxReshapeFunc(myReshape);?
auxIdleFunc(Idledisplay);?
auxMainLoop(display);?
}?


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\
?????目錄???????????0??2001-11-26?13:38??6.5??利用OpenGL實現(xiàn)三維繪圖\Debug\
?????文件??????140288??2001-11-27?02:18??6.5??利用OpenGL實現(xiàn)三維繪圖\Debug\vc60.idb
?????文件???????77824??2001-11-27?02:18??6.5??利用OpenGL實現(xiàn)三維繪圖\Debug\vc60.pdb
?????文件??????225367??2001-11-27?02:18??6.5??利用OpenGL實現(xiàn)三維繪圖\Debug\三維繪圖.exe
?????文件??????357952??2001-11-27?02:18??6.5??利用OpenGL實現(xiàn)三維繪圖\Debug\三維繪圖.ilk
?????文件???????18062??2001-11-27?02:18??6.5??利用OpenGL實現(xiàn)三維繪圖\Debug\三維繪圖.obj
?????文件?????3692672??2001-11-27?02:18??6.5??利用OpenGL實現(xiàn)三維繪圖\Debug\三維繪圖.pch
?????文件??????517120??2001-11-27?02:18??6.5??利用OpenGL實現(xiàn)三維繪圖\Debug\三維繪圖.pdb
?????目錄???????????0??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\Release\
?????文件???????50176??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\Release\vc60.idb
?????文件???????69632??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\Release\三維繪圖.exe
?????文件????????4848??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\Release\三維繪圖.obj
?????文件?????3684084??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\Release\三維繪圖.pch
?????文件????????2194??2001-11-19?20:06??6.5??利用OpenGL實現(xiàn)三維繪圖\三維繪圖.cpp
?????文件????????3551??2001-11-19?20:15??6.5??利用OpenGL實現(xiàn)三維繪圖\三維繪圖.dsp
?????文件?????????541??2001-09-26?15:50??6.5??利用OpenGL實現(xiàn)三維繪圖\三維繪圖.dsw
?????文件???????69632??2001-11-19?21:15??6.5??利用OpenGL實現(xiàn)三維繪圖\三維繪圖.exe
?????文件???????41984??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\三維繪圖.ncb
?????文件???????55808??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\三維繪圖.opt
?????文件?????????743??2012-09-01?20:09??6.5??利用OpenGL實現(xiàn)三維繪圖\三維繪圖.plg

評論

共有 條評論