2013 電腦圖學 Computer Graphics
授課教師: 葉正聖
銘傳大學資訊傳播工程系
每週主題: 程式環境、點線面顏色、移動/旋轉/縮放與矩陣(Matrix)、階層性關節轉動(T-R-T)、做出機器人、打光、貼圖、glu/glut函式、鍵盤、滑鼠、計時器(timer)、讀入3D模型、粒子系統、聲音、特效、投影矩陣、攝影機與運鏡、機器人2.0、期末作品
2013年5月24日 星期五
2013年5月17日 星期五
2013年5月10日 星期五
2013年5月3日 星期五
2013年4月26日 星期五
2013年4月12日 星期五
2013年3月29日 星期五
2013年3月22日 星期五
2013年3月15日 星期五
第四周課堂
#include<GL/glut.h>
float rot=0;
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(0.8,0.8,0);
glRotatef(rot,0,0,1);
glutSolidTeapot(0.3);
glPopMatrix();
glutSwapBuffers();
}
void idle()
{
rot++;
display();
}
int main()
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("00160760");
glutDisplayFunc(display);
glutIdleFunc(idle);
glutMainLoop();
return 0;
}
#include<GL/glut.h>
float rot=0;
void myCar()
{
glPushMatrix();
glScalef(1,0.2,0.5);
glColor3f(1,1,0);
glutSolidCube(1);
glColor3f(1,0,0);
glutWireCube(1);
glPopMatrix();
}
void display()
{
glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(-20,1,0,0);
glRotatef(rot,0,1,0);
myCar();
glPopMatrix();
glutSwapBuffers();
}
void idle()
{
rot++;
display();
}
int main()
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("00160760");
glutDisplayFunc(display);
glutIdleFunc(idle);
glutMainLoop();
return 0;
}
#include<GL/glut.h>
float rot=0;
void myBox()
{
glPushMatrix();
glScalef(1,0.2,0.5);
glColor3ub(78,69,62);
glutSolidCube(1);
glColor3f(1,0,0);
glutWireCube(1);
glPopMatrix();
}
void myBot()
{
for(int i=-10;i<10;i++)
{
glPushMatrix();
glTranslatef(0,-0.2*i,0);
glRotatef(i*rot,0,0,1);
myBox();
glPopMatrix();
}
}
void display()
{
glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(-20,1,0,0);
glRotatef(rot,0,1,0);
myBot();
glPopMatrix();
glutSwapBuffers();
}
void idle()
{
rot+=0.1;
display();
}
int main()
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("00160760");
glutDisplayFunc(display);
glutIdleFunc(idle);
glutMainLoop();
return 0;
}
2013年3月8日 星期五
2013年3月1日 星期五
2013年2月22日 星期五
訂閱:
文章 (Atom)






























