POV-Ray : Newsgroups : povray.newusers : Light. Point_at ??? : Re: Light. Point_at ??? Server Time
28 May 2024 21:14:14 EDT (-0400)
  Re: Light. Point_at ???  
From: Alain
Date: 31 May 2013 16:46:11
Message: <51a90c13$1@news.povray.org>

> Alain <kua### [at] videotronca> wrote:
>
>> Your matrix transform is applied to both the origin of your light and to
>> the point_at coordinate.
>>
>> You need to transform the location of your light BEFORE you set the
>> point_at location.
>>
>>
>> Alain
>
> Alain, Thanks, but I don't understand your idea
> Each object has own matrix. If I transform one, it will be necessary to
> transform all remaining
> The response is found in Povray documentation: matrix
> Users of Blender prompted that my problem was that axes of coordinates are
> various in Blender and in Povray
>
> // location 3.0604 0.0000 0.9887
> // x=1.000000*3.060443+0.000000*0.988657+0.000000*0.000000+3.060443=6.12
> // y=0.000000*3.060443+0.000000*0.988657+0.000000*0.000000+0.988657=1.96
> // z=0.000000*3.060443+1.000000*0.988657+0.000000*0.000000+0.000000=0.99
>
> point_at  <-0.99,-1.96,-6.12>   (-z, -y, -x)    :)
>
>
>
>
>

Yes, a given object only have one matrix... BUT...

The final matrix never need to be applied at once and, when applied in 
several steps, the part that are applied AFTER any transformation is 
never affected by any previous manipulation.
You can apply a matrix transformation, then scale, rotate or translate 
your object, add some elements like a point_at (for a light) or a 
texture (for an object), then apply another matrix transformation.

For a light source, I prefer to define it directly at it's intended 
location, not translating in any way unless it's part of some complexe 
object in an union.

Any and all transformation always apply to all elements that are defined 
previous to it's application, mever to those that follow.

Do this test:
Create a scene consisting only of a white plane and several spot lights 
like this:

#declare Middle=0;
//ground plane
plane{y,0 pigment{rgb 1/8}}

//a back plane to keep rays finite
plane{-z,-30 pigment{rgb 0}}
//the camera
camera{location<0,10,-30> look_at 0}
// setting the creation of 5 lights in a loop
#declare L_Num=5;
#while(L_Num>0)
light_source{<-25,90,0> rgb 8
spot_light radius 1 falloff 2
#if(Middle=1)translate 10*x #end
// this translate ONLY the light and NOT the point_at

point_at 0

#if(Middle=0)translate 10*x #end
// This translate BOTH the light and the point_at

#declare L_Num=L_Num-1;
#end // of the loop
media{scattering{1 rgb 0.1}}


This will create 5 tight spot lights.
If you render with Middle=0, you'll get 5 bright spots with beams that 
are parallel.
If you render with Middle=1, you'll get only 1 brighter spot with 
converging beams.
The media make the beams visible.





Alain


Post a reply to this message

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