1.網址:jsyeh.org/3dcg10
2.下載[data] [win32] [glut32.dll]

3.解壓縮WINDOWS

4.把32.glut32.dll放入WINDOWS資料夾
5.打開shapes

6.調整點線面顏色

7.線

8.顏色


作業二.
開啟codeblocks 點選GLUT project
Location 去資料夾複製網址C:\Users\USER\Desktop\freeglut-MinGW-2.8.1-1.mp\freeglut
程式碼:

#include<GL/glut.h>
void display()
{
glBegin(GL_POLYGON);
glColor3f(1,1,0);
glVertex3f(0.0,0.0,0.0);
glVertex3f(1.0,0.0,0.0);
glVertex3f(1.0,1.0,0.0);
glEnd();
//glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char**argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("hello 3D");
glutDisplayFunc(display);
glutMainLoop();
}

#include <GL/glut.h>
void display()
{
///glutSolidTeapot(0.3);
glClearColor(2, 2, 2, 2);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(47/255.0,122/255.0,215/255.0);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0);
glVertex3f(1.0, 1.0, 0.0);
glEnd();
glutSwapBuffers();
}
int main(int argc, char**argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("hello");
glutDisplayFunc(display);
glutMainLoop();
}
作業三
1.點線面顏色(進階版)

2.部落衝突的背景更改

三、
1.以小畫家設定形狀顏色及座標
2.以滑鼠點擊印出程式


沒有留言:
張貼留言