摘要: 继续捣鼓OpenGL,练习了下3D坐标下点的绘制代码如下: 1 #include<glut.h> 2 #include<math.h> 3 4 #define GL_PI 3.1415f 5 void SetupRC() 6 { 7 glClearColor(0.0f, 0.0f, 0.0f, 1.0f); 8 glColor3f(0.0f, 1.0f, 0.0f); 9 }10 11 void myDisplay(void)12 {13 GLfloat x,y;14 GLfloat sizes[2]; // 用于存储glPointSize最小有效值和最... 阅读全文
posted @ 2012-03-01 16:58 浮沉之主 阅读(1512) 评论(0) 推荐(0) 编辑
摘要: OpenGL的初步学习,具体涉及窗口初始化及创建、基本图形绘制以及简单动画效果代码如下: 1 #include<glut.h> 2 3 // initial square position and size 4 GLfloat x1 = 100.0f; 5 GLfloat y1 = 150.0f; 6 GLsizei rsize = 50; 7 8 // step size in x and y directions 9 // (number of pixels to move each time) 10 GLfloat xstep = 1.0f; 11 GLfloat ... 阅读全文
posted @ 2012-03-01 14:34 浮沉之主 阅读(581) 评论(0) 推荐(0) 编辑