OpenGL 基础图形绘制与投影变换(3)

glPushMatrix();
 glTranslated(0, 0 ,1.0); // cylinder at (0,0,1)
 GLUquadricObj * qobj;
 qobj = gluNewQuadric();
 gluQuadricDrawStyle(qobj,GLU_LINE);
 gluCylinder(qobj, 0.2, 0.2, 0.4, 8,8);
 glPopMatrix();
 glFlush();
}

//<<<<<<<<<<<<<<<<<<<<<< main >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void main(int argc, char **argv)
{
 glutInit(&argc, argv);
 glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB );
 glutInitWindowSize(640,480);
 glutInitWindowPosition(100, 100);
 glutCreateWindow("Transformation testbed - wireframes");
 glutDisplayFunc(displayWire);
 glClearColor(1.0f, 1.0f, 1.0f,0.0f);  // background is white
 glViewport(0, 0, 640, 480);//投影变换函数
 glutMainLoop();
}

Reference:

OGLplus教程学习笔记 -- Outline

OpenGL编程指南(原书第7版)中文扫描版PDF 下载

OpenGL 渲染篇

Ubuntu 13.04 安装 OpenGL

OpenGL三维球体数据生成与绘制【附源码】

Ubuntu下OpenGL编程基础解析

如何在Ubuntu使用eclipse for c++配置OpenGL

《OpenGL超级宝典》学习笔记

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/2a86919cb766d096b2be1a22d2f3294d.html