美文网首页
OpenGL 函数 glRotatef(th, x, y, z)

OpenGL 函数 glRotatef(th, x, y, z)

作者: 善法 | 来源:发表于2018-07-07 21:54 被阅读0次

表示绕旋转轴(0, 0, 0) ~ (x, y, z)旋转th角度。如:
线框球体glutWireSphere(0.8,24,12)

旋转之前
执行glRotatef(90,1,0,0)
旋转之后

源码如下

#include <windows.h>
#include <gl/glut.h>

void Paint()
{
    // glRotatef(90,1,0,0);  // 旋转
    glutWireSphere(0.8,24,12);
    glFlush();
}

int main()
{
    glutInitWindowSize(300,300);
    glutCreateWindow("测试旋转");
    glutDisplayFunc(Paint);
    glutMainLoop();
    return 0;
}

相关文章

网友评论

      本文标题:OpenGL 函数 glRotatef(th, x, y, z)

      本文链接:https://www.haomeiwen.com/subject/gxqnuftx.html