POV-Ray : Newsgroups : povray.general : Problem with area lights and transform{}? : Re: Problem with area lights and transform{}? Server Time
4 May 2024 03:00:25 EDT (-0400)
  Re: Problem with area lights and transform{}?  
From: Mike Andrews
Date: 3 May 2007 15:40:01
Message: <web.463a39e31a0c1e53866e560d0@news.povray.org>
Hi nemesis,

I'm writing a macro of the form

areaLight(_Colour,_Size,_subPanels,_Lights,_Transform)

that creates a visible light panel with the required characteristics.

I've actually figured out a generic work around given a declared transform.
Using vtransform from 'transforms.inc' you can split the translate out as
follows:

    #local _Translate = vtransform(x*0,_Transform);
    transform {_Transform translate -_Translate}
    translate _Translate

So I can finish writing the macro now :-)

Bye for now,

Mike Andrews.

"nemesis" <nam### [at] gmailcom> wrote:
> "Mike Andrews" <nomail@nomail> wrote:
> > Can anyone think of a work around or is it a show-stopper for what I was trying
> > to achieve?
>
> If your intention is to have something like:
>
> #declare tr1 = transform {rotate -90*x translate <0,2,0>}
>
> light_source { foo transform { tr1 } }
>
> Then you can accomplish the same by using a macro rather than a declare:
>
> #macro tr1() rotate -90*x translate <0,2,0> #end
>
> light_source { foo tr1()  }
>
> It's even shorter and reuses previous values just like in a declare. :)
>
> Of course, a general matrix transform won't work while the bug isn't
> corrected...


Post a reply to this message

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