开发者

setting up frustum in iphone

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜