POV-Ray : Newsgroups : povray.general : modelling parabolic reflectors in povray (photons issue) : modelling parabolic reflectors in povray (photons issue) Server Time
31 Jul 2024 10:27:55 EDT (-0400)
  modelling parabolic reflectors in povray (photons issue)  
From: Klaasvakie
Date: 4 May 2007 10:15:02
Message: <web.463b3f3ddca05642758b6c7b0@news.povray.org>
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


Post a reply to this message

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