2017電腦圖學 Computer Graphics 授課教師: 葉正聖 銘傳大學資訊傳播工程系 每週主題: 程式環境、點線面顏色、移動/旋轉/縮放與矩陣(Matrix)、階層性關節轉動(T-R-T)、做出機器人、打光、貼圖、glu/glut函式、鍵盤、滑鼠、計時器(timer)、讀入3D模型、粒子系統、聲音、特效、投影矩陣、攝影機與運鏡、機器人2.0、期末作品
2017年6月29日 星期四
2017年6月12日 星期一
20170612 Weel17 上課筆記
2017年5月22日 星期一
王華偉上課筆記 Week14 05/22
2017年5月15日 星期一
王華偉上課筆記 Week13 05/15
本週主題:
(1) 小考: T-R-T觀念
老師考前講解並用自己的手當範例

程式碼:
glPushMatrix();
glTranslate(0.4,-1.0,0);
glRotate(angle,0,0,1);
glTranslate(0.2,-0.5,0);
drawLeg();
glPopMatrix();
讀圖檔
1.安裝opencv2.1
2.確認C:\OpenCv2.1\include\opencv\很多.h檔
\lib\很多lib檔
\bin\很多dll檔
3.新增貝殼專案file-new-project,Console App
程式碼:
#include <opencv/highgui.h>
int main(){
IplImage * img=cvLoadImage("C:/小圖.png");
cvShowImage("a",img);
cvWaitKey(0);
}
轉動的地球
1.myearth解壓縮
2.解壓縮freeglut
3.開myearth專案
4.執行
(1) 小考: T-R-T觀念
老師考前講解並用自己的手當範例

程式碼:
glPushMatrix();
glTranslate(0.4,-1.0,0);
glRotate(angle,0,0,1);
glTranslate(0.2,-0.5,0);
drawLeg();
glPopMatrix();
讀圖檔
1.安裝opencv2.1
2.確認C:\OpenCv2.1\include\opencv\很多.h檔
\lib\很多lib檔
\bin\很多dll檔
3.新增貝殼專案file-new-project,Console App
程式碼:
#include <opencv/highgui.h>
int main(){
IplImage * img=cvLoadImage("C:/小圖.png");
cvShowImage("a",img);
cvWaitKey(0);
}
轉動的地球
1.myearth解壓縮
2.解壓縮freeglut
3.開myearth專案
4.執行
2017年5月8日 星期一
05/08 Week12 王華偉上課筆記
1.前往老師所提供的網址下載data,win32,glut32

2.檔案解壓縮後丟入window資料夾

3.開啟projection

4.

2.檔案解壓縮後丟入window資料夾

3.開啟projection

4.
| 加入以下程式 #include <math.h> glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60, 1, 0.001, 10000); glMatrixMode(GL_MODELVIEW); |
| 到jsyeh.org/3dcg10下載data windows glut32.dll 解壓縮windows並把glut32.dll跟data的壓縮檔拉進解壓縮的windows裡面 |
2017年5月1日 星期一
2017年4月24日 星期一
Week10 2017/04/24 王華偉上課筆記
1.至NEHE網站 前往LESSON32 課程

2.下載最下面的Visual c++ 範例


3.解壓縮至桌面\Lesson32\lesson32.exe

4.開啟應用程式Lesson32.exe

5開啟CODEBLOCKS 並開啟GLUT專案

6.再加入 #include <mmsystem.h>//多媒體系統

7.與void mouse(int button, int state, int x, int y)
{
PlaySound("data/shot.wav",NULL,SND_ASYNC);
}
跟
glutMouseFunc(mouse);

8.再加入void keyborad(unsigned char key, int x, int y)
{
PlaySound("C:\\Users\\user\\Desktop\\Lesson32\\data/shot.wav",NULL,SND_ASYNC);
}

9加入新涵式void keyborad(unsigned char key, int x, int y)
{
if(key=='1') PlaySound("Do.wav",NULL,SND_ASYNC);
if(key=='2') PlaySound("Re.wav",NULL,SND_ASYNC);
if(key=='3') PlaySound("Mi.wav",NULL,SND_ASYNC);
if(key=='4') PlaySound("Fa.wav",NULL,SND_ASYNC);
if(key=='5') PlaySound("So.wav",NULL,SND_ASYNC);
}

10.並去網路上下載WAV音樂檔,放入FREE GLUT\\BIN中資料夾

11.這樣按下鍵盤12345就會有12345檔名的聲音

2.下載最下面的Visual c++ 範例


3.解壓縮至桌面\Lesson32\lesson32.exe

4.開啟應用程式Lesson32.exe

5開啟CODEBLOCKS 並開啟GLUT專案

6.再加入 #include <mmsystem.h>//多媒體系統

7.與void mouse(int button, int state, int x, int y)
{
PlaySound("data/shot.wav",NULL,SND_ASYNC);
}
跟
glutMouseFunc(mouse);

8.再加入void keyborad(unsigned char key, int x, int y)
{
PlaySound("C:\\Users\\user\\Desktop\\Lesson32\\data/shot.wav",NULL,SND_ASYNC);
}

9加入新涵式void keyborad(unsigned char key, int x, int y)
{
if(key=='1') PlaySound("Do.wav",NULL,SND_ASYNC);
if(key=='2') PlaySound("Re.wav",NULL,SND_ASYNC);
if(key=='3') PlaySound("Mi.wav",NULL,SND_ASYNC);
if(key=='4') PlaySound("Fa.wav",NULL,SND_ASYNC);
if(key=='5') PlaySound("So.wav",NULL,SND_ASYNC);
}

10.並去網路上下載WAV音樂檔,放入FREE GLUT\\BIN中資料夾

11.這樣按下鍵盤12345就會有12345檔名的聲音
訂閱:
文章 (Atom)
































