2012年4月7日
摘要: 代码: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 GLboolean Large=GL_FALSE; //坐标单位变大或变小 5 GLint Width; //视区宽度 6 GLint Height; //视区高度 7 8 void OnDisplay(void); 9 void OnReShape(int,int); 10 void OnMouse(GLint,GLint,GLint,GLint); 11 void SetupLights(); 12 13 void main(int a.. 阅读全文
posted @ 2012-04-07 10:42 xiacl 阅读(1011) 评论(0) 推荐(0) 编辑
2012年4月6日
摘要: 效果图:代码:#define GLUT_DISABLE_ATEXIT_HACK#include "gl/glut.h"void OnDisplay(void);void OnReShape(int,int);void SetupLights();void main(int argc,char* argv[]){ glutInit(&argc,argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(600,480); glutCreateWindow(&qu 阅读全文
posted @ 2012-04-06 17:28 xiacl 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 代码: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 int i; 5 void OnMouse(GLint,GLint,GLint,GLint); 6 void OnDisplay(void); 7 void OnReShape(int,int); 8 void SetupLights(); 9 10 void main(int argc,char* argv[]) 11 { 12 glutInit(&argc,argv); 13 glutInitDisplayMode(GLU... 阅读全文
posted @ 2012-04-06 17:01 xiacl 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 效果图:代码: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 GLint Angle; 5 void OnDisplay(void); 6 void OnReShape(int,int); 7 void OnTimer(int); 8 void SetupLights(); 9 10 void main(int argc,char* argv[]) 11 { 12 glutInit(&argc,argv); 13 glutInitDisplayMode(GLUT_DOUBLE |... 阅读全文
posted @ 2012-04-06 16:42 xiacl 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 效果图:代码: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 5 void OnDisplay(void); 6 void OnReShape(int,int); 7 void SetupLights(); 8 9 void main(int argc,char* argv[])10 {11 glutInit(&argc,argv);12 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);13 glutI... 阅读全文
posted @ 2012-04-06 16:26 xiacl 阅读(384) 评论(0) 推荐(0) 编辑
2012年4月4日
摘要: 奴性哲学NO.1【你不能改变别人,只能改变自己】适用人群:这句话对有一种人是管用的,那就是一天到晚只会嫌别人做的不好,似乎全天下都欠了他从来不反思自己是不是有问题的人。特别是那种试图让全世界都按照他们的方式运转的人。只可惜,越是这种人,喊“改变自己”喊得越响,他们是在要求别人改变来适应他们的固执。奴性潜台词:改变有很多种,但是一大部分喜欢用这句话给别人洗脑的人,强调的总是让人变得柔顺的那一面。遇到了矛盾,要求你先理解体谅,先改变自己的态度,而且是“只能”这样做,他们会反复地强调你“只能”这样做,甚至把某些不该你承担的责任,推到你的头上。破解:凭什么不能改变别人,就要改变自己?需要改变的是对付别 阅读全文
posted @ 2012-04-04 18:51 xiacl 阅读(1753) 评论(0) 推荐(0) 编辑
2012年4月2日
摘要: 效果图:代码: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 4 typedef struct EyePoint{ 5 GLfloat x; 6 GLfloat y; 7 GLfloat z; 8 } EYEPOINT; 9 EYEPOINT Eye; 10 GLint WinWidth; 11 GLint WinHeight; 12 13 void OnDisplay(void); 14 void OnReShape(int,int); 15 void OnKeyboard(int,int,int. 阅读全文
posted @ 2012-04-02 09:31 xiacl 阅读(797) 评论(0) 推荐(0) 编辑
2012年3月25日
摘要: 1 #define GLUT_DISABLE_ATEXIT_HACK 2 #include "gl/glut.h" 3 #include <MATH.H> 4 5 #define RADIUS 50.0f 6 #define SIZE 100.0f 7 8 #define CONE 1 9 #define TETRAHEDRON 2 10 #define CUBE 3 11 #define DODECAHEDRON 4 12 #define ICONSAHEDRON 5 13 #define OCTAHEDRON 6 14 #def... 阅读全文
posted @ 2012-03-25 17:10 xiacl 阅读(365) 评论(0) 推荐(0) 编辑
2012年3月22日
摘要: 效果图:代码:#include "stdafx.h"// 窗口函数的函数原形LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ char szClassName[] = "MainWClass"... 阅读全文
posted @ 2012-03-22 16:49 xiacl 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 直线的扫描转换就是确定最佳逼近于该直线的一组象素,并且按扫描线顺序,对这些象素进行写操作。通常有数值微分法(DDA)、中点画线法、Bresenham算法这三个算法。数值微分法(DDA):void LineDDA ( int x0,int y0,int x1,int y1,int color){ int x,y; float dx,dy,k; dx= float(x1-x0); dy= float(y1-y0); k=dy/dx; if(abs(k)<1) { for(x=x0; x<=x1, x++) { ... 阅读全文
posted @ 2012-03-22 07:38 xiacl 阅读(513) 评论(0) 推荐(0) 编辑