POV-Ray : Newsgroups : povray.general : Transforming an image_pattern{} : Re: Transforming an image_pattern{} Server Time
26 Apr 2024 11:24:38 EDT (-0400)
  Re: Transforming an image_pattern{}  
From: Kenneth
Date: 30 May 2018 19:40:01
Message: <web.5b0f358e14fd3a80a47873e10@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> On 30-5-2018 1:37, Kenneth wrote:
> > clipka <ano### [at] anonymousorg> wrote:
> >>
> >>      #local Trans = transform {
> >>        translate <...>
> >>        ...
> >>      }
> >>
> >>      texture {
> >>        image_pattern { ... }
> >>        texture_map {
> >>          [0.0 pigment { ... transform { Trans inverse } ]
> >>          [1.0 pigment { ... transform { Trans inverse } ]
> >>        }
> >>        transform { Trans }
> >>      }
> >
> >
> > Thomas, try this example; it *looks* like it works--
>
> The first suggestion by Christoph was correct...

Yes, you're right (although with a slight change.) I had to do some more
experimenting, to see what I did wrong.

EACH index-entry in the texture_map needs the inverse transform, as Clipka
suggested. (I included only one, after your 2nd index-entry.) My way of coding
the entire construct is *slightly* different, though:

#declare MyTex =
   texture {
     image_pattern {
       png "My_pattern.png" gamma 1.0 use_alpha
       ....
       } // end of image_pattern

     transform{TRA} // THE MAIN TRANSFORM HERE

   texture_map {
       [0.0  texture{...} or pigment{...} etc
       transform{TRA inverse}
       ]
       [1.0 texture{...} or pigment...} etc
        transform{TRA inverse}
       ]
               }
           }

Thanks for giving me a 'push' to test this stuff (and to play around with the
use_alpha feature-- it may have some important implications for my 'city
buildings' scene.)


Post a reply to this message

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