Perspective function in MV.js webgl -
let's suppose clip volume [-2,2] in x,y,z. want use perspective function inbuilt in mv.js takes parameters fovy,aspect ratio,-near,-far
don't understand how choose these parameters -near,-far
.
no idea mv.js in general perspective
functions take znear , zfar parameters. set them relative scale of scene. in case might set them znear = 0.001
, zfar = 4
this make frustum (the space can see that's shaped 4 sided cone) can see things -0.001 units away origin -4 units away origin. if set znear
0.1 -0.09 clipped.
i have no idea mean suppose clip volume [-2,2] in x,y,z. clip volume of webgl -1, 1 in x,y,z.
in normal use case when apply perspective matrix clip volume becomes frustum defined parameters. z clip volume becomes -znear -zfar. x , y clip volumes scale along z axis. @ -znear y clip goes -znear/2 +znear/2 , xaxis goes -znear/2 * aspect +znear/2 * aspect. @ zfar x , y axis scaled field of view requested.
there's live digram of clip space defined perspective function on this page.
Comments
Post a Comment