POV-Ray : Newsgroups : povray.general : negative scale? : Re: negative scale? Server Time
25 Apr 2024 10:30:24 EDT (-0400)
  Re: negative scale?  
From: Thomas de Groot
Date: 24 Dec 2018 02:45:09
Message: <5c208e85$1@news.povray.org>
On 24-12-2018 4:49, Leroy wrote:
> when I use this
> function{pigment{image_map scale<-1,-1,1>}}
> I get artifacts around the edges.
> Why is this? Any one else come across this and have a work around?
> 
> Have Fun!
> 
> 

Do you intend to use this function in a height_field? I do not know if 
this is related, but I get artefacts around the edges of a image_map 
function's height_field, independently of scale by the way. I solved it 
by just intersecting away the height_field edges with a slightly smaller 
box. Like this:

//start code
#declare F_hf =
function {
   pigment {
     image_map {
       tga "My_image.tga" gamma 1.0
       map_type 0
       interpolate 2
     }
     //adding some warp
   }
}

#local CuttingKnife = 0.994;	//find minimum value experimentally
#local HF_res = 2000;

#declare HF_base =
intersection {
   height_field {
     function HF_res, HF_res {F_hf(x,y,z).hf}
     smooth
     translate <-0.5, 0, -0.5>
   }
   box {
     <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>
     scale <CuttingKnife, 2, CuttingKnife>
   }
   scale <1/CuttingKnife, 1, 1/CuttingKnife>
   scale SomeScale
   rotate SomeAngle*y
}
//end code

However, I do not know /why/ the artefacts happen, nor if this should be 
expected or not.

Hope this helps.

-- 
Thomas


Post a reply to this message

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