0
点赞
收藏
分享

微信扫一扫

《高效学习OpenGL》之 创建太阳系模型

void display(void)
{
glClear (GL_COLOR_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);

glPushMatrix();
glutWireSphere(1.0, 20, 16); /* draw sun */
glRotatef ((GLfloat) year, 0.0, 1.0, 0.0);//局部坐标系为原点,经过下行代码后,此局部坐标系向x轴走2单位
glTranslatef (2.0, 0.0, 0.0);
glRotatef ((GLfloat) day, 0.0, 1.0, 0.0);//局部坐标系为原点
glutWireSphere(0.2, 10, 8); /* draw smaller planet */
glPopMatrix();
glutSwapBuffers();
}


举报

相关推荐

0 条评论