2015 電腦圖學 Computer Graphics 授課教師: 葉正聖 銘傳大學資訊傳播工程系 每週主題: 程式環境、點線面顏色、移動/旋轉/縮放與矩陣(Matrix)、階層性關節轉動(T-R-T)、做出機器人、打光、貼圖、glu/glut函式、鍵盤、滑鼠、計時器(timer)、讀入3D模型、粒子系統、聲音、特效、投影矩陣、攝影機與運鏡、機器人2.0、期末作品
2015年6月17日 星期三
WEEK08
#include <GL/glut.h>
#include <mmsystem.h>
#include <stdio.h>
void display()
{
glutSolidTeapot(0.3);
glFlush();
}
void keyboard(unsigned char key, int x, int y)
{
if(key=='a')
{
printf("AAA\n");
}
else if(key=='b')
{
printf("BBB\n");
}
}
void mouse(int button, int state, int x, int y)
{
printf("now playing sound\n");
PlaySound("wolf2.wav",NULL,SND_ASYNC);
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutCreateWindow("02160916");
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutMouseFunc(mouse);
glutMainLoop();
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言