Scroll to navigation

GLUPERSPECTIVE(3G) GLUPERSPECTIVE(3G)

̾??

gluPerspective - Ʃ???ͱƹ????????ꤹ??

????

void gluPerspective( GLdouble fovy,

	GLdouble aspect,
	GLdouble zNear,
	GLdouble zFar )

??????

y ?????λ????Ѥ????ꤹ?롣 ñ?̤??ٿ??Ǥ??롣
?????ڥ??????????ꤹ?롣 ?????ͤ? x ?????λ??????????롣 ?????ڥ??????? x (??)?? y (?⤵)?????Ǥ??롣
?????ȡ??????˶ᤤ¦?Υ????åԥ???ʿ?̤ε?Υ?????ꤹ??(???????Ǥ???)??
?????ȡ?????????????¦?Υ????åԥ???ʿ?̤ε?Υ?????ꤹ??(???????Ǥ???)??

????

gluPerspective ?ϡ??????ѿ???(viewing frustum)??????ɺ?ɸ?? ???Ф??ƻ??ꤹ?롣 aspect=2.0 means ????Ū?ˤϡ?gluPerspective ?ǻ??ꤹ?륢???ڥ??????ϡ? ???????б??????ӥ塼?ݡ??ȤΥ????ڥ???????Ʊ???ˤʤ??٤??Ǥ??롣 ?㤨?? "aspect" ~=~ 2.0 ?ʤ??С???¬?Ԥ? x ?????λ????Ѥ? y ?????λ????Ѥ?2?ܤˤʤ롣..?ӥ塼?ݡ??Ȥ??????⤵??2?ܤʤ??С????????Ĥळ?Ȥʤ??ӥ塼?ݡ?????ɽ???????롣.P.. gluPerspective ?????ä??????ˤϡ????ߤι??󤬳ݤ??????롣?????? gluPerspective ?????ä??????????????? glMultMatrix ???ƤӽФ?????????Ʊ?ͤ?ư???Ǥ??롣..?軻???Ԥ??ΤǤϤʤ???Ʃ???ͱƹ????򸽺ߤι??󥹥??å??˥????ɤ????ˤϡ? gluPerspective ?????? glLoadIdentity ???ƤӽФ??Ƥ??????ȡ?.P. f ??.sp.ce.EQf=cotangent(fovy2) ?Τ褦???????????Ƥ??????硢 ???????????????ϼ??Τ褦?ˤʤ?:


faspect0000f0000zFar+zNearzNearzFar2*zFar*zNearzNearzFar00-10

????

?ǥץ??Хåե??????٤ϡ?zNear ?????? zFar ?˻??ꤷ?? ?ͤαƶ????????롣 zNear ???Ф??? zFar ????Ψ???礭???ۤɡ? ?ߤ??˶ᤤ???̤??ǥץ??Хåե??????̤????ݤθ?Ψ?ϰ????ʤäƤ????? ?⤷


r=zFarzNear

?ʤ??С? log2r bits of depth buffer precision are lost. ?ǥץ??Хåե??????٤Ϥ??????? log2r ?ӥåȼ??????롣 r approaches infinity as zNear approaches 0, zNear ?? 0 ?˶??դ??Ƥ????? r ??̵?????˶??դ??Ƥ??????ᡢ zNear ?? 0 ?????ꤷ?ƤϤʤ??ʤ???

??Ϣ????

glFrustum, glLoadIdentity, glMultMatrix, gluOrtho2D