• Advertisement
Sign in to follow this  

What's a good resource on field of view?

This topic is 2736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I put in anything other than 45 degrees (the radians conversion of 45 degrees), then everything looks stretched in various ways. I can do a width/height aspect ratio; that stretches things towards the sides. I can do a height/width aspect ratio, except everything is stretched in the camera's X axis.
45 degrees is a horribly limited field of view, given the average human has a horizontal 105 degree FOV. How do I get better without the view stretching?

Share this post


Link to post
Share on other sites
Advertisement
It sounds like you're doing something wrong somewhere, although I'm not quite sure what. Generally, you would set the aspect ratio for the projection to be the same as that of the viewport in which the camera is rendering; as for field of view, a typical value would be a vertical FOV of 60 degrees or so.

If with a typical setup you're getting noticeable distortion or stretching beyond what you see in other 3-d games, you're probably doing something wrong. Can you post a screenshot showing what you're talking about?

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
It sounds like you're doing something wrong somewhere, although I'm not quite sure what. Generally, you would set the aspect ratio for the projection to be the same as that of the viewport in which the camera is rendering; as for field of view, a typical value would be a vertical FOV of 60 degrees or so.

If with a typical setup you're getting noticeable distortion or stretching beyond what you see in other 3-d games, you're probably doing something wrong. Can you post a screenshot showing what you're talking about?

This is what I use to set the projection:

projection = Matrix.PerspectiveFov(fov, MainData.Display.Width / (double)MainData.Display.Height, near, far);


public static Matrix PerspectiveFov(double fov, double aspect, double near, double far)
{
double yScale = 1.0 / Math.Tan(fov / 2);
double xScale = yScale / aspect;
return new Matrix(
xScale, 0, 0, 0,
0, yScale, 0, 0,
0, 0, far / (far - near), 1,
0, 0, -near * far / (far - near), 0
);
}


This is an establishing shot at 90 degrees FOV:
Stretching1

This is an image from the same location, only with the mountain peak on the left side of the screen:
Stretching2

Images are larger than they need to be, but the distortion should be quite viewable.

Share this post


Link to post
Share on other sites
Quote:
Original post by rouncED
All games have this distortion your seeing, theres nothing you can do about it.

...I'd say it's strange I haven't noticed, but it really isn't.

I suppose I could study math for the next forty years, totally redesign the 3D system and get rid of the distortion...But that seems an overreaction. For one thing, by that time a bunch of other people will have probably redesigned it anyway. *Snark*

To clear up probably one last thing, am I seeing 60 degrees horizontal or 96 on my 1.6 aspect ratio monitor? It looks like 96.

Share this post


Link to post
Share on other sites
Is this distortion less evident if the objects are further away from the camera? Does anyone know what causes the distortion in the first place?

Share this post


Link to post
Share on other sites
Quote:
Original post by stevenmarky
Does anyone know what causes the distortion in the first place?


If you measure the distance from your eye to the screen and the size of the screen, you can deduce what the FOV of your setup is. You'll find that the angle is generally too small to use in a game, so you'll want to cover a larger angle. The distortion comes from the mismatch between the angle the screen actually covers in front of your eye and the projection you are using. If you place yourself close enough to the screen so the it actually covers the angle that it should cover, there is no distortion.

Share this post


Link to post
Share on other sites
Quote:
Original post by alvaro
Quote:
Original post by stevenmarky
Does anyone know what causes the distortion in the first place?


If you measure the distance from your eye to the screen and the size of the screen, you can deduce what the FOV of your setup is. You'll find that the angle is generally too small to use in a game, so you'll want to cover a larger angle. The distortion comes from the mismatch between the angle the screen actually covers in front of your eye and the projection you are using. If you place yourself close enough to the screen so the it actually covers the angle that it should cover, there is no distortion.

Could you calculate the FOV of the screen and do some sort of interpolation or other calculation between the two and get rid of the distortion?

Probably not, because it seems implicit in the FOV calculations - You'd simple end up reducing your FOV. I think.

Share this post


Link to post
Share on other sites
Hi,
Quote:
The distortion comes from the mismatch between the angle the screen actually covers in front of your eye and the projection you are using. If you place yourself close enough to the screen so the it actually covers the angle that it should cover, there is no distortion.
This is absolutely correct. Your distortion is due to the fact that although your eye sweeps out its 105° arc, it expects to see your game world as a small fraction of it's 105° field of view, corresponding to the smaller angle that the screen subtends.

Ideally, you'd want the center of projection to be at the viewer's eye for the FOV calculation, but there's no way of calibrating your user in this way! For this reason, it's generally accepted that you pick "what looks right". Usually, this works out to be around 40°-70°. I typically use 45°, and adjust as necessary.

-G

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement