POV-Ray : Newsgroups : povray.general : Problem with area lights and transform{}? : Re: Problem with area lights and transform{}? Server Time
4 May 2024 07:23:11 EDT (-0400)
  Re: Problem with area lights and transform{}?  
From: Alain
Date: 3 May 2007 17:55:54
Message: <463a5a6a@news.povray.org>
Mike Andrews nous apporta ses lumieres en ce 03-05-2007 05:37:
> Hi Folks,
> 
> I was playing with a macro to create area lights and hit a snag. One of the
> parameters was a transform{} block to position the light and this seems to
> be working wrong.
> 
> After some tinkering I came up with a fairly minimal scene that shows the
> problem on my system, in that using a rotate and translate either directly
> or in a transform{} block give different results in the Windows version of
> 3.6.1c.
> 
> Can someone confirm the problem or point out what I'm doing wrong? I find it
> hard to believe that it is a bug in such a well used part of the code ...
> 
> Thanks,
> 
> Mike Andrews.
> 
> // --- Start of areaLightTransform.pov ---
> 
> // +w640 +h480 +a0.1
> // Change useTransform to 'on' to see problem
> 
> #declare useTransform = off;
> 
> global_settings {
>   assumed_gamma 1.0
>   max_trace_level 50
>   ambient_light 1
> }
> 
> camera {
>  up <0, 1, 0>
>  right x*image_width/image_height
>  location  <-1, 15, -25>
>  angle     10
>  look_at   0
> }
> 
> plane {
>   y, 0
>   pigment { rgb 1 }
>   finish { diffuse 1 ambient 0 brilliance 0.5 }
> }
> 
> light_source {
>   0, rgb 1
>   area_light x,y, 2,2
>   #if (useTransform)
>     transform {rotate -90*x translate <0,2,0>}
>   #else
>     rotate -90*x translate <0,2,0>
>   #end
> }
> 
> #declare tBlack = texture {
>   pigment { rgb 0 }
>   finish { diffuse 0 ambient 0 }
> }
> 
> cylinder { -y,0.3*y,0.02 translate < 0,0,-1> texture {tBlack} }
> cylinder { -y,0.3*y,0.02 translate <-1,0,0>  texture {tBlack} }
> cylinder { -y,0.3*y,0.02 translate < 0,0,0>  texture {tBlack} }
> cylinder { -y,0.3*y,0.02 translate < 1,0,0>  texture {tBlack} }
> cylinder { -y,0.3*y,0.02 translate < 0,0,1>  texture {tBlack} }
> 
> // --- End of areaLightTransform.pov ---
> 
> 
> 
> 
The transform aparently translate THEN rotate.
When you rotate your area_light, it stay in place but the plane of the aray does 
rotate and become horizontal, you then you translate it 2 unit straight up.

-- 
Alain
-------------------------------------------------
I can read your mind, and you should be ashamed of yourself.


Post a reply to this message

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