1. 下載: sorce , date , win32 ,glut32.dll ( jsyeh.org/3dcg10 )
2.檔案放在一起

3.開起其中一個,試著調整數值

hw-02
建立GLUT專案
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.5,0,0.5);//可以改變水壺的顏色
glClearColor(1,0.5,0,0.5);改變背景顏色
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DEPTH);
glutCreateWindow("hello");
glutDisplayFunc(display);
glutMainLoop();

沒有留言:
張貼留言