Perspective problem

Blitz3D Forums/Blitz3D Beginners Area/Perspective problem

Akira(Posted 2004) [#1]
Can anyone tell me why it is that objects appear to get noticeably closer and stretch as you rotate away from them, especially as they get closer to the edge of the screen?

Is there a way to reduce/eliminate this this effect whilst still maintaining some semblance of perspecitve?

Thanks in advance...


WolRon(Posted 2004) [#2]
I believe you are interested in either or both of these commands:

CameraProjMode
CameraZoom


Akira(Posted 2004) [#3]
Thanks for your reply WolRon..

I have played with CameraProjMode and unfortunately mode 0 effectively hides the camera and mode 2 destroys perspective altogether.

I have also experimented with CameraZoom, and although this reduced the perspective/stretching problem it magnified everything on the screen. If I were to use this solution I would have to rescale everything to compensate for the zoom. Is this the best/only solution?


danjo(Posted 2004) [#4]
there was some FOV stuff in the code archives.


Akira(Posted 2004) [#5]
Thanks for your reply Danjo.

I had a look for the FOV entries in the code archives and only came up with an entry by SSWIFT that gave an example (below) of how to use CameraZoom to restrict the field of view to a fixed arc (in degrees). The narrower the FOV, the greater the ZOOM.


Function SetCameraFOV(Camera, FOV#)
CameraZoom Camera, 1.0 / Tan(FOV#/2.0)
End Function


I guess this still leaves me with the question of whether CameraZoom is the only/best way to fix the problem. Although it does tend to point to it being the only way.


Rob Farley(Posted 2004) [#6]
Personally I stick the camerazoom at 1.5 and everything looks about right... Of course I have no mathematical reason behind this, it just seems to look and feel right.


jfk EO-11110(Posted 2004) [#7]
Indeed, the default value of 1.0 for the zoom makes things look stretched. But when you set it to eg. 1.5, the world becomes so small :) it's a dilemma.


TomToad(Posted 2004) [#8]
Seems I remember that you can use ScaleEntity camera,x,y,z to alter the perspective. Never tried it, I usually just use CameraZoom.


Akira(Posted 2004) [#9]
Thanks for the replies guys...

I tried scaling the camera and that didn't fix the problem.

It looks like most people are using CameraZoom, so I guess that must be the only way to do it.


Mustang(Posted 2004) [#10]
It looks like most people are using CameraZoom, so I guess that must be the only way to do it.


Yes. When you do 3D, you have to decide what FOV you're going to use.. most FPS games like Quake etc use 90 deg FOV but that might be bit too much - you get some perspective distortion and draw more stuff (making your world slightly slower). Too small FOV is no good either; bit like having a tunnel vision. Human eye FOV is around 60 deg (sharp & focused) but we do sense movement almost 180 deg, so 90 deg is not such bad compromise because 3D graphic displays don't work like human eye, so you cannot simulate it perfectly either.


Akira(Posted 2004) [#11]
Thanks for the info Mustang.

It's interesting because a CameraZoom of 1.5 equates to a FOV of 67.38 degrees which is reasonably close to the 60 degree human FOV.

Maybe that's why a zoom of 1.5 seems to look and feel right for Rob. (To get a FOV of 60 degrees requires a zoom of 1.73205)