一樣先下載windows, data, 32.dll檔
fov: feld of view 視野
fovy: Y方向的視野
zNear: Z方向,進的面
zFar: Z方向,遠的面
fovy: Y方向的視野
zNear: Z方向,進的面
zFar: Z方向,遠的面
- left: 近的面左邊界
- right: 近的面右邊界
- bottom: 近的面下邊界
- top: 近的面上邊界
- near: 近的面離攝影機的距離
- far: 遠的面離攝影機的距離
- glOrtho()(方形)
- gluLookAt()(攝影機調整)
- ctrl+F 搜尋 resize
- 將 glFrustum() 改成 gluPerspective()
切邊框:改原函式glFrustum變成gluPerspective

static void resize(int width, int height)
{
const float ar = (float) width / (float) height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
///glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);
gluPerspective( 60, 1, 0.001,1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity() ;
}
縮放視線

static void resize(int width, int height)
{
const float ar = (float) width / (float) height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
///glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);
///gluPerspective( 60, 1, 0.001,1000);
glOrtho(-2.4, +2.4, -1.2, +1.2, -6.0 ,+6.0); (太大了)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity() ;

***適當調整***
glOrtho(-3.4, +3.4, -2.2, +2.2, -6.0 ,+6.0);

static void resize(int width, int height)
{
const float ar = (float) width / (float) height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
///glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);
gluPerspective( 60, 1, 0.001,1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity() ;
}
縮放視線

static void resize(int width, int height)
{
const float ar = (float) width / (float) height;
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
///glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);
///gluPerspective( 60, 1, 0.001,1000);
glOrtho(-2.4, +2.4, -1.2, +1.2, -6.0 ,+6.0); (太大了)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity() ;

***適當調整***
glOrtho(-3.4, +3.4, -2.2, +2.2, -6.0 ,+6.0);



沒有留言:
張貼留言