2012年5月6日
摘要: #define GLUT_DISABLE_ATEXIT_HACK #include <GL/glut.h>#define WIDTH 64#define HEIGHT 64GLubyte Image[HEIGHT][WIDTH][4];GLfloat xRot;void makeImage(void){ int i, j, c; for (i = 0; i < HEIGHT; i++) { for (j = 0; j < WIDTH; j++) { c = ((((i&0x8)==0)^((j&0x8))==0))*255; ... 阅读全文
posted @ 2012-05-06 17:01 xiacl 阅读(2380) 评论(0) 推荐(0) 编辑
2012年4月30日
摘要: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 GLubyte zebra[]={0x00,0x00,0x00,0x00, 5 0x37,0x20,0x00,0x00, 6 0x13,0x60,0x00,0x00, 7 0x10,0x60,0x00,0x00, 8 0x14,0x60,0x00,0x00, 9 0x16,0x38,0x00,0x00,10 ... 阅读全文
posted @ 2012-04-30 10:46 xiacl 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include <stdio.h> 3 #include <gl/glut.h> 4 #include <gl/glaux.h> 5 #pragma comment(lib,"glaux.lib") 6 7 8 AUX_RGBImageRec* Image; 9 GLint iWidth,iHeight,iMode=1; 10 GLubyte* pImage; 11 12 void Initialization(void); 13 void MenuCreate( 阅读全文
posted @ 2012-04-30 10:03 xiacl 阅读(697) 评论(0) 推荐(0) 编辑
2012年4月20日
摘要: 1 #include "gl/glut.h" 2 3 #define MODE_NONE 0 4 #define MODE_LINEAR 1 5 #define MODE_EXP 2 6 #define MODE_EXP2 3 7 8 GLint fogMode; 9 10 void Initialization(void); 11 void OnDisplay(void); 12 void OnReShape(int,int); 13 void OnMenu(int); 14 void CreateMenu(void); 15 void DrawTeapot(GLf... 阅读全文
posted @ 2012-04-20 17:21 xiacl 阅读(522) 评论(0) 推荐(0) 编辑
2012年4月17日
摘要: 1 #include "gl/glut.h" 2 3 void Initialization() 4 { 5 glClearColor(0.0f,0.0f,0.0f,1.0f); 6 7 GLfloat lightSpecular[]={1.0,1.0,1.0,1.0}; 8 GLfloat lightPosition[]={0.5,0.5,4.0,0.0}; 9 10 glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); //指定混合函数11 glShadeModel(GL_SMOOTH);12 13... 阅读全文
posted @ 2012-04-17 22:29 xiacl 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 1 #include "gl/glut.h" 2 3 void Initialization() 4 { 5 glClearColor(0.0f,0.0f,0.0f,1.0f); 6 7 glEnable(GL_BLEND);//启用混合状态 8 } 9 10 void OnDisplay(void)11 {12 GLUquadricObj *obj; //定义实用库中的二次曲面指针13 14 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);15 16 glMatrixMode(GL_MODEL... 阅读全文
posted @ 2012-04-17 22:00 xiacl 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 1 #include "gl/glut.h" 2 #define NO 0 3 #define YES 1 4 5 int Drawing; 6 7 void Initialization() 8 { 9 glClearColor(0.0f,0.0f,0.0f,1.0f); 10 11 glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_DST_ALPHA); 12 13 glEnable(GL_POINT_SMOOTH); //启用点反走样 14 glHint(GL_POINT_SMOOT... 阅读全文
posted @ 2012-04-17 20:50 xiacl 阅读(1099) 评论(0) 推荐(0) 编辑
2012年4月13日
摘要: 代码: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 void OnDisplay(void); 5 void OnReShape(int,int); 6 void OnKey(GLubyte,GLint,GLint); 7 void SetupRC(); 8 void SetupLights(); 9 10 void main(int argc,char* argv[]) 11 { 12 glutInit(&argc,argv); 13 glutInitD... 阅读全文
posted @ 2012-04-13 17:09 xiacl 阅读(337) 评论(0) 推荐(0) 编辑
2012年4月8日
摘要: 效果图:代码: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 5 GLfloat AngleX; 6 GLfloat AngleY; 7 8 void OnDisplay(void); 9 void OnReShape(int,int); 10 void OnKey(GLint,GLint,GLint); 11 void SetupRC(); 12 13 void main(int argc,char* argv[]) 14 { 15 glutInit(&argc,argv); 16 gl 阅读全文
posted @ 2012-04-08 11:55 xiacl 阅读(927) 评论(0) 推荐(0) 编辑
2012年4月7日
摘要: 效果图:代码: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 GLfloat AngleX=0.0f; //绕X轴的旋转角度 5 GLfloat AngleY=0.0f; //绕Y轴的旋转角度 6 7 8 void OnDisplay(void); 9 void OnReShape(int,int); 10 void OnKey(int,int,int); 11 void SetupLights(); 12 13 void main(int argc,char* argv[]) 14 { 1... 阅读全文
posted @ 2012-04-07 11:23 xiacl 阅读(1243) 评论(0) 推荐(0) 编辑