| 查看: 841 | 回复: 11 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
马东阳银虫 (小有名气)
|
[求助]
Linux中用VIM编译GL库的问题 已有1人参与
|
|
|
我用Code::Block敲了一段代码,成功输出阻尼震荡图形! 假如写进vim中命名为test.c,可以用gcc编译吗? #include<GL/gl.h> #include<GL/glu.h> #include<GL/glut.h> #include<math.h> const int screenWidth=640; const int screenHeight=480; GLdouble a,b,c,d; void myInit(void){ glClearColor(1.0,1.0,1.0,0.0); glColor3f(0.0f,0.0f,0.0f); glPointSize(2.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0,(GLdouble)screenWidth,0.0,(GLdouble)screenHeight); a=screenWidth/4.0; b=0.0; c=d=screenHeight/2.0; } void myDisplay(void){ glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POINTS); for(GLdouble x=0;x<4.0;x+=0.005){ GLdouble func=exp(-x)*cos(2*3.1415926*x); glVertex2d(a*x+b,c*func+d); } glEnd(); glFlush(); } int main(int argc,char**argv){ glutInit(&argc,argv); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); glutInitWindowSize(screenWidth,screenHeight); glutInitWindowPosition(100,150); glutCreateWindow("Dot Plot of a Function" ;glutDisplayFunc(myDisplay); myInit(); glutMainLoop(); } |
» 猜你喜欢
275学硕081000服从调剂到其他专业,保不住本专业了
已经有8人回复
085600,320分求调剂
已经有4人回复
071000生物学调剂
已经有4人回复
材料与化工306分找调剂
已经有3人回复
一志愿北京科技材料科学与工程288分,求调剂
已经有10人回复
一志愿同济大学323分(080500)求调剂
已经有6人回复
一志愿085600中科院宁波所276分求调剂
已经有26人回复
材料专硕322分
已经有7人回复
材料调剂
已经有4人回复
294分080500材料科学与工程求调剂
已经有17人回复

马东阳
银虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 2042.2
- 散金: 300
- 帖子: 118
- 在线: 23.2小时
- 虫号: 2752467
- 注册: 2013-10-25
- 性别: GG
- 专业: 化学工程及工业化学

5楼2015-10-20 07:43:45
2楼2015-10-19 23:07:53
lvweizhong
铜虫 (著名写手)
- 应助: 57 (初中生)
- 金币: 3181.3
- 红花: 10
- 沙发: 1
- 帖子: 2064
- 在线: 167.6小时
- 虫号: 3683385
- 注册: 2015-02-09
- 专业: 数论
3楼2015-10-19 23:09:21
马东阳
银虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 2042.2
- 散金: 300
- 帖子: 118
- 在线: 23.2小时
- 虫号: 2752467
- 注册: 2013-10-25
- 性别: GG
- 专业: 化学工程及工业化学

4楼2015-10-20 07:43:08














;
回复此楼