POV-Ray : Newsgroups : povray.advanced-users : Simulating vignetting in a camera : Re: Simulating vignetting in a camera Server Time
29 Jul 2024 04:26:43 EDT (-0400)
  Re: Simulating vignetting in a camera  
From: hughes, b 
Date: 8 Feb 2003 00:48:59
Message: <3e449a4b@news.povray.org>
I was beginning to try degrees in that before posting before and quit since
I wasn't seeing anything right still. Turns out I had to go with radians to
equal the same result for degrees in the MS "PowerToys" calculator I needed
to use because my Casio calculator needs batteries again. Nice to see I
wasn't on the wrong path by thinking it was to do with degrees, but this
calc was originally set to radians and I wasn't getting results right with
it either until I changed to degrees. Mental block prevented me from trying
radians in POV-Ray. Just needed degrees and that wasn't happening right.
Funny I couldn't figure this out at the time, but it's because I don't keep
in mind how POV deals with such things.

I wanted to find out about this idea so I'm glad I had help and the
incentive from Don Barron. Now I'm wondering if the sphere is the ideal
object or if it should be a disc... but then where to position it? Guess I'm
not going to want to know this for perfection of the concept, maybe Don
might though. Anyway, again:

/* cos 4th power law of lens light falloff. Thanks guys: Tor Olav
Kristensen, and Slime */

#declare A=67; // angle
#declare R=<10,0,0>; // orientation
#declare L=<0,0,-5>; // location
#declare V=A; // variable, degrees? probably still not true to the real
world(?)

camera {
  location  0
  look_at   z
  angle A
  rotate R
  translate L
}

/* okay, so it's cosine of radians of the angle apparently, or whatever.
yea! */
sphere {
  0, 1
  texture {
    pigment {
      cylindrical
      color_map {
        [0 color rgb 0 transmit 1 ]
        [pow(cos(radians(V/2)),4) color rgb 0 transmit
pow(cos(radians(V/2)),4) ]
        [1 color rgb 0 transmit 0 ]
      } frequency -1 rotate 90*x
    }
    finish{
      ambient 0 diffuse 0
    }
  }
  scale 0.0001 // make small/invisible
  rotate R
  translate L
}

/* now if I just knew any better way to blend-map that, if can be */

#debug concat("\n cos 4th law: value for ",str(V,0,0)," degrees is
",str(pow(cos(radians(V/2)),4),-1,9),"\n")

// ----------------------------------------

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0 rgb <0.7,0.8,0.9>]
      [1 rgb <0.2,0.5,0.8>]
    }
  }
}

light_source {
 <-30, 30, -30>,1
}

plane {
  y, -1
 pigment {color rgb 1}
}

sphere {
  0.0, 1
 pigment {color rgb 1}
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.