POV-Ray : Newsgroups : povray.newusers : Light. Point_at ??? : Re: Light. Point_at ??? Server Time
26 Jun 2024 01:53:24 EDT (-0400)
  Re: Light. Point_at ???  
From: Stephen
Date: 30 May 2013 16:25:18
Message: <51a7b5ae$1@news.povray.org>
On 30/05/2013 6:05 PM, LanuHum wrote:
> Alain <kua### [at] videotronca> wrote:
>
>>
>> Use #declare to define your object.
>> #declare Object_name= ...
>> Replace "..." by the definition of your object.
>>
>> Now, you can use
>> #declare Center=(min_extent(Object_name)+max_extent(Object_name))/2;
>> to get the center point of it's bounding box.
>> Use that value as your point_at location: point_at Center
>>
>> Alternatively, if you create your object around the origin and translate
>> it into location, use the same coordinates for the translate and
>> point_at location.
>>
>>
>>
>> Alain
>
> object {
>      Sphere_001
>      matrix <1.000000, 0.000000, 0.000000,  0.000000, -0.000000, -1.000000,
> 0.000000, 1.000000, -0.000000,  3.060443, 0.988657, -0.000000>
>
> }
> #declare Center=(min_extent(Sphere_001)+max_extent(Sphere_001))/2;
> //--Lamps--
>
> light_source {
>      < 0,0,0 >
>      color rgb<0.6, 0.6, 0.6>
>      spotlight
>      falloff 37.50
>      radius 31.874999
>      tightness 0
>      point_at  Center
>      fade_distance 14.999991
>      fade_power 2
>      matrix <-0.942444, 0.000000, 0.334364,  0.268584, 0.595619, 0.757034,
> -0.199154, 0.803267, -0.561337,  3.196899, 5.407235, -3.778671>
> }
>
> Doesn't work. All black. Light doesn't fall on the Sphere_001
>
>

I think that what is going wrong is that you are creating the spotlight 
at the origin, pointing it at the sphere then transposing it with your 
matrix function. So the spotlight ends up not pointing at the sphere.

Try this:

object {
      Sphere_001
      matrix <1.000000, 0.000000, 0.000000,  0.000000, -0.000000, -1.000000,
0.000000, 1.000000, -0.000000,  3.060443, 0.988657, -0.000000>

}
#declare Center=(min_extent(Sphere_001)+max_extent(Sphere_001))/2;
//--Lamps--

light_source {

           matrix <-0.942444, 0.000000, 0.334364,  0.268584, 0.595619, 
0.757034,
-0.199154, 0.803267, -0.561337,  3.196899, 5.407235, -3.778671>

      color rgb<0.6, 0.6, 0.6>
      spotlight
      falloff 37.50
      radius 31.874999
      tightness 0
      point_at  Center
      fade_distance 14.999991
      fade_power 2
}





-- 
Regards
     Stephen


Post a reply to this message

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