POV-Ray : Newsgroups : povray.general : The question about of projected through option Server Time
24 Nov 2024 18:24:17 EST (-0500)
  The question about of projected through option (Message 1 to 10 of 22)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Masaki 
Subject: The question about of projected through option
Date: 15 Dec 2017 07:30:01
Message: <web.5a33bfe58bbfd557bde21ec0@news.povray.org>
There are two things I want you to ask for a favor.

I want to make the light source, which is positioned randomly between y=0~1 and
emits the light at the specific angle, 45 degrees. The light beam forms the
conical surface.
(Q1) Can I make this light source ?

I conceive that if the light through the torus (or the disk) is only rendering,
the above requirement can meet. So, I write the source code as follows, but the
pov-ray dose not work properly. It seems to be wrong with the "projected
through" option.
(Q2) What is wrong in my source code and how to  revise it ?


The pov-ray version is 3.7.

source code:
*********************************************
#include "colors.inc"
#include "textures.inc"

background{Black}

camera {

    location <0, -1, 0>
    right <-1.33, 0, 0>
    angle 40
    look_at <0, 0.5, 0>
  }


 //Source

 #declare r2 = seed(12345);
 #declare I = 0;
 #declare number = 10;



 #while (I < number)

 #declare a = rand(r2);

 #declare Object1 = torus {
                            0.1, 0.05

                            sturm
                            translate <0, a-0.1, 0>

 }


 light_source {

        <0, a, 0>
        color 100000
        projected_through {Object1}

        }



#declare I = I+1;
#end

 *********************************************


Sincerely,
Yoneyama.


Post a reply to this message

From: William F Pokorny
Subject: Re: The question about of projected through option
Date: 15 Dec 2017 10:08:02
Message: <5a33e552$1@news.povray.org>
On 12/15/2017 07:28 AM, Masaki  wrote:
> There are two things I want you to ask for a favor.
> 
> I want to make the light source, which is positioned randomly between y=0~1 and
> emits the light at the specific angle, 45 degrees. The light beam forms the
> conical surface.
> (Q1) Can I make this light source ?

I know of no built in way to strictly get a conical light source where 
all the rays are at 45 degrees relative to some light source axis.

Perhaps with photons and the right sort of lens system? Hmm... Wonder if 
something could be done with using radiosity where the bright object had 
an aoi pattern which gets bright only when the ray angle is very near 45 
degrees? Would depend upon geometry of your scene I suppose. Plus with 
the radiosity I question how well it might work with respect to 
radiosity's sampling.

Approximations are possible where the conical ring of light still 
spreads over distance from the point source as you are attempting.

> 
> I conceive that if the light through the torus (or the disk) is only rendering,
> the above requirement can meet. So, I write the source code as follows, but the
> pov-ray dose not work properly. It seems to be wrong with the "projected
> through" option.
> (Q2) What is wrong in my source code and how to  revise it ?
> 

Assuming you have a plane or other objects in your scene which will be 
lit, try changing your light source from:

  color 100000

to:

  color 1/number

I think it probable you are getting a result where everything is clamped 
to 'white' given your very bright light source has not been set up to 
fade as real lights do with distance. The light source might be too 
bright for your particular scene dimensions even with realistic light 
fading.

If I've guessed wrong as to the problem you see, please post a more 
complete scene with lit objects and more specifically what you think is 
not working. Note that given your largish torus minor axis dimension and 
relative point light position there will be significant light spreading 
and overlap.

Bill P.


Post a reply to this message

From: Stephen
Subject: Re: The question about of projected through option
Date: 15 Dec 2017 10:41:05
Message: <5a33ed11@news.povray.org>
On 15/12/2017 15:08, William F Pokorny wrote:
> I know of no built in way to strictly get a conical light source where 
> all the rays are at 45 degrees relative to some light source axis.

I thought you could but I can't get it to work.

Below is the code I got working for LH coordinates.
What puzzles me is that I had to rotate the light source by 180° to get 
the light to show.



////////////////////////////

#version 3.6;

background { colour rgb <0.000,0.000,0.000> }

// 
****************************************************************************
// referenced scene items and forced visible scene items declaration begin
// 
****************************************************************************

#declare Blue_White_Tiles2 =
texture {
   checker
   texture {
     pigment {
       colour rgbft <1.000,1.000,1.000,0.000,0.000>
     }

     finish {
       ambient     rgb <0.100,0.100,0.100>
       brilliance  1.000
       crand       0.000
       diffuse     0.600
       metallic    0.000
       phong       0.000
       phong_size  40.000
       specular    0.000
       roughness   0.249
       reflection {
         rgb <0.100,0.100,0.100>, rgb <0.000,0.000,0.000>
         fresnel   0
         falloff   0.000
         exponent  1.000
         metallic  0.000
       }
     }

   }

   texture {
     pigment {
       colour rgbft <0.000,0.502,1.000,0.000,0.000>
     }

     finish {
       ambient     rgb <0.100,0.100,0.100>
       brilliance  1.000
       crand       0.000
       diffuse     0.600
       metallic    0.000
       phong       0.000
       phong_size  40.000
       specular    0.000
       roughness   0.249
       reflection {
         rgb <0.100,0.100,0.100>, rgb <0.000,0.000,0.000>
         fresnel   0
         falloff   0.000
         exponent  1.000
         metallic  0.000
       }
     }

   }

   rotate    <0.0,0.0,180.000>
   rotate    <-90.000,0.0,0.0>
   scale     <-300.000,-300.000,-1000.000>
   rotate    <90.000,0.000,-180.000>
   rotate    <0.000,-180.000,0.000>
   scale     <0.010,0.010,0.010>
}

#declare Object1 =
torus {
   0.100000,0.050000
   sturm
   translate <0.000000,0.366564,0.000000>
}  // end Object1

#declare Camera0 =
camera {
   perspective
   location <-0.006,12.002,-10.392>
   up y
   right -1.333*x
   angle 33.000
   sky <0.000,0.655,0.756>
   look_at < 0.000, 0.000, 0.000 >
}  // end Camera0


// 
****************************************************************************
// referenced scene items and forced visible scene items declaration end
// 
****************************************************************************

light_source {  // Light_Source1
   < 0.000000, 0.000000, 0.000000 >, colour rgb <1.000,0.000,1.000>*10.000
   fade_power 0.000
   fade_distance 100.000
   media_attenuation off
   media_interaction on
   projected_through {Object1}
   rotate    <180.000000,0.000000,0.000000>
   translate <0.000000,1.275000,0.000000>
}  // end Light_Source1

union {  // Lights
   light_source {  // Shadowless_Light_Source0
     < 0.000000, 0.000000, 0.000000 >, colour rgb <1.000,1.000,1.000>
     fade_power 0.000
     fade_distance 100.000
     media_attenuation off
     media_interaction on
     shadowless
     translate <15.811000,100.000000,-200.977356>
   }  // end Shadowless_Light_Source0

   light_source {  // Light_Source0
     < 0.000000, 0.000000, 0.000000 >, colour rgb <1.000,1.000,1.000>
     fade_power 0.000
     fade_distance 100.000
     media_attenuation off
     media_interaction on
     translate <-24.636320,55.859425,-195.075000>
   }  // end Light_Source0

   translate <0.000000,0.000000,-74.423000>
}  // end Lights

plane {  // Plane1
   y , 0
   texture{ Blue_White_Tiles2 }
   translate <0.000000,-1.964000,0.000000>
}  // end Plane1


camera{ Camera0 }




-- 

Regards
     Stephen


Post a reply to this message

From: clipka
Subject: Re: The question about of projected through option
Date: 15 Dec 2017 11:05:05
Message: <5a33f2b1$1@news.povray.org>
Am 15.12.2017 um 16:40 schrieb Stephen:
> On 15/12/2017 15:08, William F Pokorny wrote:
>> I know of no built in way to strictly get a conical light source where
>> all the rays are at 45 degrees relative to some light source axis.
> 
> I thought you could but I can't get it to work.

It's not possible to limit the light source to rays at /exactly/ 45
degrees, as that would be an infinitesimally thin cone, and the
raytracing algorithm wouldn't catch any of the light (except by mere
coincidence).

To limit the light to, say, between 40 to 50 degrees, you could create a
spotlight with a 50 degree angle, and another spotlight with a 40 degree
angle and /negative/ brightness.

However, using a point light and a torus as a `projected_through` object
/should/ also work in principle.


Post a reply to this message

From: Stephen
Subject: Re: The question about of projected through option
Date: 15 Dec 2017 12:23:41
Message: <5a34051d$1@news.povray.org>
On 15/12/2017 16:05, clipka wrote:
> Am 15.12.2017 um 16:40 schrieb Stephen:
>> On 15/12/2017 15:08, William F Pokorny wrote:
>>> I know of no built in way to strictly get a conical light source where
>>> all the rays are at 45 degrees relative to some light source axis.
>>
>> I thought you could but I can't get it to work.
> 
> It's not possible to limit the light source to rays at /exactly/ 45
> degrees, as that would be an infinitesimally thin cone, and the
> raytracing algorithm wouldn't catch any of the light (except by mere
> coincidence).
> 

Muddled thinking on my part.

> To limit the light to, say, between 40 to 50 degrees, you could create a
> spotlight with a 50 degree angle, and another spotlight with a 40 degree
> angle and /negative/ brightness.
> 
> However, using a point light and a torus as a `projected_through` object
> /should/ also work in principle.
> 

It does, it gives a disk like beam. The code I posted on the duplicate 
of this thread shows that.
But it did not until I rotated the the light source by 180°. Rotating it 
by less than that makes it behave as if you are rotating a torch. It 
gives an elliptical beam.

That puzzles me as it was a point source.

-- 

Regards
     Stephen


Post a reply to this message

From: Bald Eagle
Subject: Re: The question about of projected through option
Date: 15 Dec 2017 12:35:05
Message: <web.5a3406f351d01bcdc437ac910@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> It's not possible to limit the light source to rays at /exactly/ 45
> degrees, as that would be an infinitesimally thin cone, and the
> raytracing algorithm wouldn't catch any of the light (except by mere
> coincidence).
>
> To limit the light to, say, between 40 to 50 degrees, you could create a
> spotlight with a 50 degree angle, and another spotlight with a 40 degree
> angle and /negative/ brightness.


Clever!  :)
I was thinking about using a point, or spotlight, and a CSG object - a box with
a conical cutout, and a smaller solid cone in front of it - forming a
cone-shaped void for the light pass through.

> However, using a point light and a torus as a `projected_through` object
> /should/ also work in principle.

Also very clever  :)

From:   http://www.povray.org/documentation/view/3.7.0/316/
"Any textures or interiors on the object will be stripped and the object will
not show up in the scene."

Is that an accurate description?
I have questioned in the past if texturing could be stripped from objects so
that a later texturing could be used (overriding the prior texture), as I
believe Kenneth has as well.

If `projected_through` indeed works by this retroactive mechanism, then could
there possibly be an `override_texture` directive in the future?


Post a reply to this message

From: Stephen
Subject: Re: The question about of projected through option
Date: 15 Dec 2017 13:07:40
Message: <5a340f6c$1@news.povray.org>
On 15/12/2017 17:31, Bald Eagle wrote:

> From:   http://www.povray.org/documentation/view/3.7.0/316/
> "Any textures or interiors on the object will be stripped and the object will
> not show up in the scene."
> 
> Is that an accurate description?

Depends how you define accurate.  :-)
If you call the object as well as defining it. The textures are still there.


> I have questioned in the past if texturing could be stripped from objects so
> that a later texturing could be used (overriding the prior texture), as I
> believe Kenneth has as well.
> 
> If `projected_through` indeed works by this retroactive mechanism, then could
> there possibly be an `override_texture` directive in the future?
> 

It would be good if it could be done.


-- 

Regards
     Stephen


Post a reply to this message

From: Kenneth
Subject: Re: The question about of projected through option
Date: 17 Dec 2017 13:40:01
Message: <web.5a36b93051d01bcd89df8d30@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

>
> To limit the light to, say, between 40 to 50 degrees, you could create a
> spotlight with a 50 degree angle, and another spotlight with a 40 degree
> angle and /negative/ brightness.
>

That's an interesting concept: 'negative' light, to subtract from another light.
Such an idea never occured to me, one worth checking out; thanks.


Post a reply to this message

From: Masaki 
Subject: Re: The question about of projected through option
Date: 18 Dec 2017 06:45:00
Message: <web.5a37a9c351d01bcdc32dd2d00@news.povray.org>
I appreciate for your kind advice.

I started pov-ray recently, so it takes some time to understand the all advice.
I would like to try the two way, projected through and spotlights.

The projected through puzzled me, so I have to consider.

There are two questions about using spotlight.




The reason why I place the 10 lights is that I want to know the response when
the light source moves in the depth direction, but I am very happy if the
reasonable result is obtained from the one light at first.

I post again the source code with object (hexagonal prism).

////////////////////////////////////////////////
#include "colors.inc"
#include "textures.inc"

background{Black}

camera {

    location <0, -3, 0>
    right <-1.33, 0, 0>
    angle 40
    look_at <0, 0.5, 0>
  }



//Object
object {
  prism {
    linear_sweep
    linear_spline
    0.
    1.
    7.
    <2,0>, <1,1.7320508>, <-1,1.7320508>, <-2,0>, <-1, -1.7320508>,
<1,-1.7320508>, <2,0>

       hollow


      material {


         texture {

            pigment { rgbf<1.0, 1.0, 1.0, 0.7> }

            finish {
               specular 1
               roughness 0.001
               ambient 0
               diffuse 0

               reflection {
                  0.1
                  fresnel on
               }

               conserve_energy
            }

         }

      }

      interior {
         ior 1.458
         fade_distance 1.0
         fade_power 2
      }
    }
}

 //Source
 #declare r2 = seed(12345);
 #declare I = 0;
 #declare Number = 10;



 #while (I < Number)

 #declare A = rand(r2);

 #declare Object1 = torus {
                            0.1, 0.05
                            sturm
                            translate <0, A-0.1, 0>

 }





 light_source {

        <0, A, 0>
        color
        projected_through {Object1}

        }



#declare I = I+1;
#end
/////////////////////////////////////////////////////////////////

Regards,

Masaki


Post a reply to this message

From: Stephen
Subject: Re: The question about of projected through option
Date: 18 Dec 2017 08:14:56
Message: <5a37bf50$1@news.povray.org>
On 18/12/2017 11:42, Masaki  wrote:
> I appreciate for your kind advice.
> 

Thanks for all of us.

> I started pov-ray recently, so it takes some time to understand the all advice.
> I would like to try the two way, projected through and spotlights.
> 

There are a couple of things wrong with your scene. First, your lights 
and objects are inside the Prism. So you will not see anything.
The Prism is 1 unit thick. So move it down a bit.
The camera is pointing the wrong way as the light source needs to be 
above the projected through object. For the effect to work. Only where 
the light rays hit the object will they be calculated. So multiply the 
camera position by -1 * Y and maybe give it a little offset in the X or 
Y direction.

There is no need to create so many lights and objects by putting them in 
the loop. If you create then outside the loop then call or reference 
them from inside the loop. It is more efficient, I am told.

> The projected through puzzled me, so I have to consider.
> 
> There are two questions about using spotlight.
> (1) How can I configurate the “negative” option?
Multiply the colour by -1.

> (2) Can the “negative” light distinguish the “positive” light completely?
> It seems that the “negative” light only weaken the positive light.
> 
Yes, remember the lights value is not limited to 1


> The reason why I place the 10 lights is that I want to know the response when
> the light source moves in the depth direction, but I am very happy if the
> reasonable result is obtained from the one light at first.
> 
That sounds as if you want to make an animation.

> I post again the source code with object (hexagonal prism).


-- 

Regards
     Stephen


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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