setting up frustum in iphone

849 views Asked by At

I have set up a frustum with fov=50, near=0.1,far=1000,aspect ratio=3/2 yet it isn`t coming nice--my object appears to be compressed on far side.suggest something that might help.

1

There are 1 answers

3
datenwolf On

A screenshot would help. But I think I understand your problem. What you're observing are the effects of an affine projection. The parameter fov is a bit misleading, as it might suggest you have some angular projection (fisheye) which is not the case. What actually happens is, that the extents of the near projection plane are placed so that it's borders are seen under the fov angle. However the near plane is just that, flat that means, so very large fovs look very unnatural.

I don't know the specs of the iPhone's graphics capabilities from heart, but if I'm not mistaken it supports vertex shaders. So instead of the affine frustum projection method you could implement a totally different kind of projection model, like sterographic or mercator (depending on what your needs are). Operations are then no longer performed in terms of linear matrix multiplication.

As a side note: Those values for near and far distance are too extreme, almost all of the depth buffer precision will be between 0.1 and ~20, due to the nonlinearity of depth buffering in perspective mode.