POV-Ray : Newsgroups : povray.general : Help with macro(s) for simulating weather patterns : Re: Help with macro(s) for simulating weather patterns Server Time
29 Jul 2024 14:22:54 EDT (-0400)
  Re: Help with macro(s) for simulating weather patterns  
From: D103
Date: 21 Apr 2012 20:40:01
Message: <web.4f9352ddd5742bdd5ae2687f0@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
>
> Your problem is that your image is still mapped from <0,0> to <1,1> and
> tilled to cover the whole plane.
> As you iterate through your loop, you effectively sample the exact same
> point of your image every time.
> If you add the "once" keyword, then all results would be zeros except
> for one.
>
> 2 possibilities:
> 1 - Scale your image and scan it in unit increments. Sample:
> #declare ImgTraceObj = plane {
>    -z, 0
>    pigment {
>      ColImg scale<Xres, Yres,1>
>    }
> }
> OR
> #declare ImgTraceObj = plane {
>    -z, 0
>    pigment {
>      ColImg
>    }
> scale<Xres, Yres,1>}
>
> As it's a plane (an infinite object) passing through the origin (point
> <0,0,0>), there is no differences between the two cases.
>
> 2 - Keep the image unchanged, but scan it in 1/Xres and 1/Yres increments.
> Sample:
> #declare TmpCol = eval_pigment(ColImg, <XCount/Xres, YCount/Yres, 0>);
>
> For large images, this can introduce some location errors due to
> floating point rounding and presision errors.
>
>
>
> Alain

Ok, thanks very much. :) I think I'll use the scale pigment, floating point
precision errors are not what I need.

Regards,
D103


Post a reply to this message

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