POV-Ray : Newsgroups : povray.general : modelling parabolic reflectors in povray (photons issue) : Re: modelling parabolic reflectors in povray (photons issue) Server Time
31 Jul 2024 10:20:05 EDT (-0400)
  Re: modelling parabolic reflectors in povray (photons issue)  
From: Alain
Date: 4 May 2007 21:33:03
Message: <463bdecf$1@news.povray.org>
Klaasvakie nous apporta ses lumieres en ce 04-05-2007 10:12:
> Hi
> 
> I am trying to model a parabolic reflector. The beam pattern I am seeing is
> not what I expect. I cannot post attachments, so I will post the scene file
> and add some of my comments inbetween.
> 
> //standard stuff
> #include "colors.inc"
> 
> //turn photons on
> //As far as I can tell the only way for my light
> //source to bounce off the sides of my reflector
> //is to use photons, am I right?
> global_settings {
>         photons {
>                 count 200000  //a lot of them because I dont know any better
> and it still renders quick
> 
>                 autostop 1
>         }
> }
> 
> 
> // a bit about the dimensions. I am working in
> //metres with the reflector being 0.029 metres
> //(30 millimetres) long and 0.0115 metres  (11.5
> //millimetres) in diameter.
> //The reflector is in the centre of a 20m cube
> //The camara is placed roughly 2cm in front of our
> //reflector looking straight down the barrel
> camera {
>         location <0, 0.05, 0>
>         look_at <0, 2, 0>
> }
> 
> 
> 
> //generate the constants for our parabola
> //the parabola is calculated given that I know
> //two points which it must pass through <x1,y1>
> //and <x2,y2>. This makes it easy for me to spec
> //the bottom and top diameters and parabola length
> //and the rest is calculated.
> 
> 
> //two known points.
> #declare x1 = 0.004;
> #declare y1 = 0;
> #declare x2 = 0.011;
> #declare y2 = 0.029;
> 
> // for a parabola centered on the y axis
> // y = a*x^2 + c;
> 
> 
> //calculate a from our two points
> #declare a = (y1 - y2)/(pow(x1,2) - pow(x2,2));
> //calculate c
> #declare c = y1-a*pow(x1,2);
> 
> //find the focal point.
> //the focal point is where the derivative is
> //equal to 1;
> #declare fp_x = 1/(2*a);
> #declare fp = a*pow(fp_x,2) + c;
> 
> //macro for returning an xypoint on the parabola
> //given the x position.
> #macro return_point(X)
>         #local P = <X,(a*pow(X,2)+c)>;
>         P
> #end
> 
> 
> //finally, generate the reflector
> #declare loopx=0;
> lathe {
>         linear_spline
>         int(((0.0115)/0.0005)+1), //calculate how many points we have
>         // generate the points
>         #while (loopx<0.0115)
>                 return_point(loopx),
>                 #declare loopx=loopx+0.0005; //ove in half a millimetre
> steps
>         #end
>         //put the last point in
>         <0.0115,(a*pow(0.0115,2) + c)> // add the final point
> 
>         pigment { White } //white sounds decent no?
>         finish {
>                 reflection {<0.9,0.9,0.9>} // make it nice and shiny
>         }
> 
>         photons { target reflection on } //make sure photons reflect off of
> it
> }
> 
> // put a light source at the focal point of the reflector
> light_source {
>         <0,fp,0> color White
> }
> 
> 
> // make something for the beam to hit.
> box {
>         <-10, -10, -10>, <10, 10, 10>
> 
>         pigment { color Blue } hollow
> 
>         finish {
>                 phong 0.3
>         }
> }
> 
> 
> When I rendre this scene I expect to get a nice collimated clump of light in
> the centre and some side spread, but instead I get a set of saturny-type
> rings with a white dot in the middle. I played with the number of photons
> and also the finishes on the box (phong) but no luck.
> 
> Can anyone please point me in the right direction. What am I not getting?
> 
> Thanks in advance,
> 
> Cheers,
> 
> Johann
> 
> 
You are using very small values. When I multiply all your values by 100, I get a 
bright and sharp bright spot without any ring. This point to precision related 
errors from the floating point processor.
Changing your base unit from meter to centimeter or milimeter could realy help.

-- 
Alain
-------------------------------------------------
'The Computer made me do it.'


Post a reply to this message

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