gluLookAt explanation?

后端 未结 3 1883
生来不讨喜
生来不讨喜 2020-12-23 21:10

Trying to understand gluLookAt, especially the last 3 parameters.

Can someone please explain ?

gluLookAt(camera[0], camera[1], camera[2], /* look f         


        
3条回答
  •  太阳男子
    2020-12-23 22:04

    first 3 parameters are camera position next 3 parameters are target position the last 3 parameters represent the rolling of camera.

    Very important thing use gluLookAt after "glMatrixMode(GL_MODELVIEW);"

    Other useful hint always specify it 0,0,1 for last 3 parameters. In general co-ordinates are written as x,y,z. z is up vector. the 0,1,0 leads in confusion as x,z,y.

    so best thing leave it to 0,0,1.

提交回复
热议问题