(2) 矩陣 投影矩陣
(3) 攝影機運鏡
(4) 會動的機器
(5)補 MP3播放
mp3播放
todo:播mp3最簡單 CMP_MCI.h
#include "CMP3_MCI.h" //檔案放在目錄
CMP3_MCI myMP3; // 宣告變數
在int main()裡
int main(....)
myMP3.Load("音樂.mp3"); //Load檔案
myMP3.Play(); // play播放
若無法執行跑出CMP3_MCI.CPP
則點選專題 按右鍵 Build Option Linker setting add winmm(新增媒體播放)
gluLookAt()應用 //調視角
float eyeX=0,eyeY=0,eyeZ=1;float centerX=0,centerY=0,centerZ=0;
float upX=0,upY=1,upZ=0;
static void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3d(1,0,0);
glPushMatrix();
gluLookAt(eyeX,eyeY,eyeZ,
centerX,centerY,centerZ,
upX,upY,upZ);
glutSolidTeapot(0.3);
glPopMatrix();
glutSwapBuffers();
}
gluPerspective.cpp
glMatrixMode(GL_PROJECTION);//臨時切換成projection矩陣
glLoadIdentity();
gluPerspective(60,1,0.001,10000);
//60=張角,1=xy比例,0.001=z的方向,10000=zfar
glMatrixMode(GL_MODELVIEW);//切回model view矩陣
TRT手臂
沒有留言:
張貼留言