POV-Ray : Newsgroups : povray.general : The question about of projected through option Server Time
29 Apr 2024 03:25:30 EDT (-0400)
  The question about of projected through option (Message 3 to 12 of 22)  
<<< Previous 2 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

From: Stephen
Subject: Re: The question about of projected through option
Date: 18 Dec 2017 08:17:08
Message: <5a37bfd4$1@news.povray.org>
On 18/12/2017 13:14, Stephen wrote:
> So multiply the camera position by -1 * Y and maybe give it a little 
> offset in the X or Y direction.

Oops! I use a LH co-ord system.

Should be: offset in the X or Z direction

-- 

Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: The question about of projected through option
Date: 18 Dec 2017 18:13:03
Message: <5a384b7f$1@news.povray.org>
Le 17-12-18 à 06:42, Masaki  a écrit :
> 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.
> (1) How can I configurate the “negative” option?

light_source{Location rgb -1}
Any negative value mean a negative light. The intensity of a light can 
have almost any value in a range of -1e12 to 1e12... And, if the light 
is not white, a component can be negative while the others are positive 
like rgb<-2, 1, 0.7>

> (2) Can the “negative” light distinguish the “positive” light completely?
> It seems that the “negative” light only weaken the positive light.

It can totally suppress a normal light. It only need to have the same or 
larger intensity.

> 
> 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.

In that case, it may be a good idea to use coloured lights. That way, 
you'll be better able to distinguish them.

> 
> 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 {//you don't need that object wrapper.
>    prism {
>      linear_sweep
>      linear_spline
>      0.
>      1.
>      7.

This risk been interpreted as 0.1, 7.0
Replace those dots with comas.

>      <2,0>, <1,1.7320508>, <-1,1.7320508>, <-2,0>, <-1, -1.7320508>,
> <1,-1.7320508>, <2,0>
> 
>         hollow

Not needed unless you plan adding some media. hollow is only meant to 
allow an object to contain some media.

> 
> 
>        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
>        }
>      }
> }

For a material, you should use fade_power 1 or fade_power 1001 to get a 
more realistic result.
fade_power 2 is for light attenuation over a distance in empty space.

If you want the light trajectory to show in that object, you need to 
fill it with some scattering media. As it is now, the light can only 
show at the surface. It's made impossible by the diffuse 0, meaning that 
the surface don't diffuse any of the incoming light.

> 
>   //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>
> 
>   }

You should make your torus much thinner. As it is now, the illuminated 
areas from the various lights overlap a lot unless you are very close to 
the torus.

#declare Object1 = torus{0.1, 0.002 translate <0, -0.1, 0>}

> 
> 
> 
> 
> 
>   light_source {
> 
>          <0, A, 0>
>          color
	rgb<rand(r2),rand(r2),rand(r2)>
Makes your lights multi-coloured

>          projected_through {Object1}
> 
>          }
> 
> 
> 
> #declare I = I+1;
> #end
> /////////////////////////////////////////////////////////////////
> 
> Regards,
> 
> Masaki
> 
> 
>


Post a reply to this message

<<< Previous 2 Messages Goto Latest 10 Messages Next 10 Messages >>>

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