openGL三维图形xyz轴旋转与平移.docVIP

  • 34
  • 0
  • 约3.09千字
  • 约 4页
  • 2018-05-18 发布于河南
  • 举报
openGL三维图形xyz轴旋转与平移

#include GL/glut.h static GLfloat angle = 0.0; static GLfloat movex = 0.0; static GLfloat movey = 0.0; static GLfloat len = 1.0; static GLint x=0.0,y=0.0,z=0.0; static void init() { glClearColor(1.0, 1.0, 1.0, 0.0); } void display() { glClear(GL_COLOR_BUFFER_BIT); glColor3f(0.0, 1.0, 1.0); glPushMatrix(); glTranslatef(movex, movey, 0.0); glScalef( len, len, len ); glRotatef(angle, x,y, z); glutWireSphere(40, 16, 16); glPopMatrix(); glFlush(); } void moveright()

文档评论(0)

1亿VIP精品文档

相关文档