POV-Ray : Newsgroups : povray.general : The question about of projected through option Server Time
31 Oct 2024 21:28:27 EDT (-0400)
  The question about of projected through option (Message 1 to 3 of 3)  
From: Masaki 
Subject: The question about of projected through option
Date: 15 Dec 2017 07:30:00
Message: <web.5a33bf428bbfd557bde21ec0@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,
Masaki Yoneyama.


Post a reply to this message

From: Stephen
Subject: Re: The question about of projected through option
Date: 15 Dec 2017 10:17:11
Message: <5a33e777$1@news.povray.org>
Hello Masaki

And welcome


On 15/12/2017 12:25, 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 ?
> 

Use a spotlight with the parallel keyword


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

To start with you need something for the light to shine on. So put a 
plane with a texture in your scene. Below your camera so the light 
shines on it.
When testing set your variable Number to 1. Also it is good practice to 
capitalise your variables so they will not conflict with PovRay's own 
variables.
Pull your camera back or use a wide angle to get a wider view.

I don't want to confuse things by supplying code as I use Left Handed 
scenes with Y up. And changing coordinate systems confuses me.

But when I imported your scene into a modelling program. It looked like 
you camera was pointing the wrong way if the plane was through the origin.






> 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,
> Masaki Yoneyama.
> 
> 


-- 

Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: The question about of projected through option
Date: 16 Dec 2017 15:48:58
Message: <5a3586ba@news.povray.org>
Le 17-12-15 à 07:25, Masaki  a écrit :
> 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 ?
Yes.

> 
> 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 ?
> 
>
> 
> Sincerely,
> Masaki Yoneyama.
> 
> 

Use only a single light_source.
rgb 1e5 is extremely bright. You only use such a bright light when you 
also use light fading with a short fade_distance.

Why place 10 lights? Their illumination bands will overlap.
You need some surface to get illuminated or some media to make the light 
visible.

My proposition :

#declare R2= seed(frame_number);
//#declare R2= seed(12345678*clock);
//Make the seed change when using the animation feature

#declare V_Pos = rand(R2)
light_source{
  <0,V_Pos ,0>
  rgb 100000
		fade_power 2
		fade_distance 0.02
  projected_through{
	cylinder{<0,V_Pos-1,0><0,V_Pos-1.1,0>,1 open}
	//makes a thin cone
	//open used to remove the end caps
	//as we only want the side
	}
  }

plane{-z, -0.1 pigment{rgb 1} finish{brilliance 0}}
//Add something for the light to shine on
//and make it's illumination independent from the angle of incidence

Render with +kff 9 on the command line.


Post a reply to this message

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