(1)網址:https://jsyeh.org/3dcg10
下載教材data win32 glut32.dll
(2)將檔案解壓縮,執行shapes
vertex:頂點, float:浮點數
課堂作業(二)(三)
程式碼
#include <GL/glut.h>
void display()
{
glutSolidTeapot(0.3);
glutSwapBuffers();
glColor3f(1,0.25,0.2); //改顏色RGBA
glClear(GL_COLOR_BUFFER_BIT); //把屏幕上的颜色清空
glClearColor(1,1,0,0);
}
int main( int argc,char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("hello3D");
glutDisplayFunc(display);
glutMainLoop();
}



沒有留言:
張貼留言