2016年3月7日 星期一

Week03_黃慧緣

課堂作業 1

教材:jsyeh.org/3dcg10

下載紅色框的東西



*把data和glut32.dll放進windows資料夾






課堂作業 2

*搜尋 freeglut windows download

下載 ↓ ↓ ↓


*資料夾 freeglut - lib - 複製 libfreeglut.a 改名為 libglut32.a

CodeBlocks開啟 - File / New / Project選GLUT專案 -
(A) Project name
(B) 在桌面 (‧‧‧)
(C) C:\users\user\Desktop\freeglut
*找freeglut mingw版本.zip 把裡面glut資料夾copy到桌面
- Build&Run




glVertex2f(x,y);
glVertex3f(x,y.z);

色彩
glColor3f(r,g,b);


#include <GL/glut.h>
void display()
{

    glBegin(GL_POLYGON); //polygon→多邊形
        glColor3f(5,5,0); //3f→3個浮點數
        glVertex2f(0.5,0.5); //vertex→頂點
        glVertex2f(0.5,-0.5); //2f→2個頂點(2個浮點數)
        glVertex2f(0,0);
    glEnd();
    glutSwapBuffers();
}
int main(int argc, char**argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("hello");

    glutDisplayFunc(display);

    glutMainLoop();
}















回家作業




沒有留言:

張貼留言