Scroll to navigation

GLULOOKAT(3G) GLULOOKAT(3G)

̾??

gluLookAt - ?ӥ塼???????Ѵ???????????

????

void gluLookAt( GLdouble eyeX,

	GLdouble eyeY,
	GLdouble eyeZ,
	GLdouble centerX,
	GLdouble centerY,
	GLdouble centerZ,
	GLdouble upX,
	GLdouble upY,
	GLdouble upZ )

??????

?????ΰ??֤????ꤹ?롣
???????ΰ??֤????ꤹ?롣
up ?٥??ȥ????????????ꤹ?롣

????

gluLookAt ?ϻ??????????????濴?򼨤????????? UP ?٥??ȥ뤫???ӥ塼???󥰹????????롣

???ι????ϻ??????? z ????(??ɸ???????ϰ?)?˥ޥåפ??? ???????????˥ޥåפ??롣 ???????äơ????̤μͱƹ??󤬻Ȥ????Ƥ????Ȥ??ϡ????????? ?濴?ϥӥ塼?ݡ??Ȥ??濴?˥ޥåפ????롣 Ʊ?ͤˡ??ӥ塼??????ʿ?̾??????Ƥ????? UP ?٥??ȥ뤬?????????ϡ? y ????(??ɸ???????ϰ?)?˥ޥåפ????롣 ???κݤ??????ϡ??ӥ塼?ݡ??????Ǿ????????褦?ˤ????롣 UP ?٥??ȥ??ϡ??????Ȼ??????????ֻ?????ʿ?ԤˤʤäƤϤʤ??ʤ???

????

F=centerXeyeXcenterYeyeYcenterZeyeZ.P?Ȥ???

(upX,upY,upZ) . UP ???٥??ȥ? (upX,upY,upZ) ?Ȥ??롣

???ξ??硢???????ϼ??Τ褦?ˤʤ?????: f=F||F||

UP=UP||UP||

s=f×UP , and u=s×f . ?Ǹ??ˡ? s=f×UP , u=s×f ?Ȥ??롣

?????? M ?ϼ??Τ褦???Ȥ?Ω?Ƥ?????: M=s[0]s[1]s[2]0u[0]u[1]u[2]0-f[0]-f[1]-f[2]00001

?ޤ???gluLookAt ?? glMultMatrixf(M); glTranslated (-eyex, -eyey, -eyez);

???????Ǥ??롣

??Ϣ????

glFrustum, gluPerspective