|
![](/i/fill.gif) |
On Wed, 23 Jun 1999 21:48:29 +0200, Fabien Mosen wrote:
>A difference in the way images with an ultra_wide_angle camera are
>rendered between Official and Patched Pov.
>
>Please look in binaries.images for a message with the same subject,
>and complete explanation and examples...
Neither one is right. Consider this scene:
camera
{
location 0
direction z
angle 120
ultra_wide_angle
}
light_source { 0 color rgb 1 }
#declare i=0;
#while (i<360)
sphere { 40*z, 1 rotate i*y texture {pigment {color rgb 1}}}
sphere { 40*z, 1 rotate i*x texture {pigment {color rgb 1}}}
sphere { 40*z, 1 rotate i*x rotate 45*z texture {pigment {color rgb 1}}}
#declare i=i+10;
#end
The superpatch renders this with what looks like an angle of 160, while
the official version renders it at 100. I haven't investigated why there's
a difference yet.
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Ron Parker wrote:
> On Wed, 23 Jun 1999 21:48:29 +0200, Fabien Mosen wrote:
> >A difference in the way images with an ultra_wide_angle camera are
> >rendered between Official and Patched Pov.
> >
> >Please look in binaries.images for a message with the same subject,
> >and complete explanation and examples...
>
> Neither one is right. Consider this scene:
>
> camera
> {
> location 0
> direction z
> angle 120
> ultra_wide_angle
> }
>
> light_source { 0 color rgb 1 }
>
> #declare i=0;
> #while (i<360)
> sphere { 40*z, 1 rotate i*y texture {pigment {color rgb 1}}}
> sphere { 40*z, 1 rotate i*x texture {pigment {color rgb 1}}}
> sphere { 40*z, 1 rotate i*x rotate 45*z texture {pigment {color rgb 1}}}
>
> #declare i=i+10;
> #end
>
> The superpatch renders this with what looks like an angle of 160, while
> the official version renders it at 100. I haven't investigated why
there's
> a difference yet.
>
I've stated in binaries.images that Suprtpatch renders the example scene
correctly (which obviously is wrong).
I think I got it now:
Superpatch corrects the mistake of forgetting to multiply by PI,
but ignores the fact (as does POV) the direction vector got
normalized during the parsing process (at least if the "angle"
keyword is used), but not the right and up vector.
The code should look something like this:
----------------------------------------------------------------------------
---
case ULTRA_WIDE_ANGLE_CAMERA:
/* Convert the x coordinate to be a DBL from -0.5 to 0.5. */
x0 = x / (DBL)Frame.Screen_Width - 0.5;
/* Convert the y coordinate to be a DBL from -0.5 to 0.5. */
y0 = ((DBL)(Frame.Screen_Height - 1) - y) /
(DBL)Frame.Screen_Height - 0.5;
/* Get aspect ratio, normalize camera vectors */
if (Precompute_Camera_Constants)
{
VLength(lx, FCR);
VLength(ly, FCU);
/* The inverse of the usual aspect ratio */
Camera_Aspect_Ratio = ly / lx;
VNormalize(FCR, FCR);
VNormalize(FCU, FCU);
VNormalize(FCD, FCD); /* If not normalized in "angle"-
statement in parse.c */
}
/* Create primary ray. */
x0 *= Frame.Camera->Angle * M_PI_180;
y0* = Frame.Camera->Angle * Camera_Aspect_Ratio *
M_PI_180;
cx = cos(x0); sx = sin(x0);
cy = cos(y0); sy = sin(y0);
VLinComb3(Ray->Direction, sx, FCR, sy, FCU, cx * cy, FCD);
initialize_ray_container_state(Ray,
Precompute_Camera_Constants);
Precompute_Camera_Constants = FALSE;
break;
----------------------------------------------------------------------------
---
Hope I haven't put in an "alternative" bug ;)
BTW, this "ignoring to normalize camera vectors" seems to
apply to the cylindrical cameras, too.
And in "fisheye" and "omnimax" these two statements
initialize_ray_container_state(Ray,
Precompute_Camera_Constants);
Precompute_Camera_Constants = FALSE;
should be moved up here to _really_ get a spherical image instead of an
elliptic one in case the aspect ratio != 1:
/* If the pixel lies outside the unit circle no ray is traced. */
if (rad > 1.0)
{
return(FALSE);
}
(other code....)
Hope this is useful,
Gerald.
Post a reply to this message
|
![](/i/fill.gif) |