色彩 glColor3f(R,G,B);

到 http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/
下載老師編輯的"data","win32(window系統)",和
"glut32.dll" 將其解壓縮後即可操作一些成品

要製作這個三角形
到先網路找Freeglut
http://www.transmissionzero.co.uk/software/freeglut-devel/
找到MinGW的版本

將其解壓縮後要將"libfreeglut"改成"freeglut32"

然後開Code::blocks來開新專案
選用GLUT
然後
#include <GL/glut.h>
void display()
{
glBegin(GL_POLYGON);
//拉出一個多邊形(POLYGON)
glColor3f(1,1,0);
//將其填入顏色(R.G.B)
glVertex2f(0.5,0.5);
glVertex2f(0.5,-0.5);
glVertex2f(0,0);
拉出多邊形
glEnd();
glutSwapBuffers();
}
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("hello");
glutDisplayFunc(display);
glutMainLoop();
}


沒有留言:
張貼留言