2016電腦圖學

2016 電腦圖學 Computer Graphics 授課教師: 葉正聖 銘傳大學資訊傳播工程系 每週主題: 程式環境、點線面顏色、移動/旋轉/縮放與矩陣(Matrix)、階層性關節轉動(T-R-T)、做出機器人、打光、貼圖、glu/glut函式、鍵盤、滑鼠、計時器(timer)、讀入3D模型、粒子系統、聲音、特效、投影矩陣、攝影機與運鏡、機器人2.0、期末作品

2016年3月7日 星期一

week03





程式:#include <GL/glut.h>void display(){    ///glutSolidTeapot(0.3);    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();}

著色


#include <GL/glut.h>void display(){    ///glutSolidTeapot(0.3);    glBegin(GL_POLYGON);        glColor3f(1,0,0);   glVertex2f(1,1);        glColor3f(0,1,0);   glVertex2f(1,-1);        glColor3f(0,0,1);   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();}


青仔 於 下午1:51
分享

沒有留言:

張貼留言

‹
›
首頁
查看網路版
技術提供:Blogger.