|
![](/i/fill.gif) |
Alain <aze### [at] qwerty org> 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
|
![](/i/fill.gif) |