Title: Viewing specification for Ray Tracing Post by: asimes on January 06, 2013, 09:24:47 PM Given these variables:
- VRP, the point of attention that the viewer is focusing on - VPN, the normalized direction to viewer - d, the distance from the point of attention to the viewer - uMin / uMax / vMin / vMax, the view plane boundaries on some axes u and v - PRP, the location of the viewer calculated as: Code: PRP.x = (VRP.x+VPN.x*d, VRP.y+VPN.y*d, VRP.z+VPN.z*d) How do you know what the value of d should be? In my program I have these variables set as: - VRP = (0.0, 0.0, 0.0), could change while the program is running in the future - VPN = (1.0, 0.0, 1.0), could change while the program is running in the future - d is arbitrarily set as 40.0 for now - uMin = -40, uMax = 40, vMin = -40, vMax = 40 Title: Re: Viewing specification for Ray Tracing Post by: asimes on January 06, 2013, 09:29:23 PM This might be helpful...
(http://140.129.20.249/~jmchen/cg/docs/rendering%20pipeline/rendering/11.gif) (PRP and d are not in the image above) Title: Re: Viewing specification for Ray Tracing Post by: hobold on January 07, 2013, 07:39:09 AM The value of d is indeed not fixed. You can choose it to influence the "field of view", i.e. the angle between the eye point, the leftmost column of pixels and the rightmost column of pixels.
Small values of d widen the field of view, i.e. the resulting picture captures things that are to the far left and far right of the viewer. But in that case, perspective distortion is strong, and faraway objects appear very small. It's more like a fish eye lens. Larger values of d narrow down the view. Objects to the sides are out of frame, but perspective distortion is less pronounced. Objects don't shrink as fast with growing distance from the viewer. This is more like a telescopic lens. Title: Re: Viewing specification for Ray Tracing Post by: asimes on January 07, 2013, 10:51:34 PM Ah, thank you, I didn't realize a fish eye effect would happen from a small value of d. I just assumed my rays were somehow firing incorrectly.
The problem seems to go away when d has the same value as the view plane boundaries (u is 80 units wide and v is 80 units tall). If I were to make it more wide than tall, what would be suggested to do with d? Title: Re: Viewing specification for Ray Tracing Post by: hobold on January 07, 2013, 11:40:13 PM what would be suggested to do with d? Experiment and use whatever looks good. :)In a sense, this is a matter of artistic expression. Unless you want to match a particular camera model, or want the viewers to move very close to or very far from the display screen. |