並下載[data][win32][glut32.dll]
把data和glut32.dll解壓縮後
放進windows解壓的資料夾
打開Transformation
打開shapes 做點線面的改變
用codeblocls開一個GLUT project
選freeglut打程式
#include <GL/glut.h>
void display()
{
glBegin(GL_POLYGON);//切換頂點跟色彩
glColor3f(1,1,0);//色彩
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 3D");
glutDisplayFunc(display);
glutMainLoop();
}




沒有留言:
張貼留言