課堂作業1
好棒棒上傳





課堂作業2
1打開上課網址下載DATA WIN32 GLUT32

打開TRANSFORM

旋轉他~~~


課堂作業3
讓茶壺到處跑
程式碼
#include <GL/glut.h>
float nowX=0, nowY=0;
void mouse(int button, int state, int x, int y)
{
nowX = (x-150)/150.0; nowY=-(y-150)/150.0;
}
void display()
{
glClearColor(1,1,0,1);
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glTranslatef(nowX, nowY, 0);
glColor3f(1,0,0);
glutSolidTeapot(0.3);
glPopMatrix();
glutSwapBuffers();
}
int main(int argc, char**argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("Hello");
glutDisplayFunc(display);
glutMouseFunc(mouse);
glutMainLoop();
}

沒有留言:
張貼留言