01-1
將window.exe解壓縮,並開啟Transformation.exe
可以切換translatef和rotatef(有差別)
原因: 先後執行的差別
https://120.125.80.50/GL/
讓茶壺把手為中心旋轉
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(angle,0,0,1);
glTranslatef(0.4,-0.07,0);
glColor3f(1,0,0.5);
glutSolidTeapot(0.3);
glPopMatrix();
glutSwapBuffers();
}
int main( int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("12 TRT");
glutDisplayFunc(display);
glutMainLoop();
}

沒有留言:
張貼留言