POV-Ray : Newsgroups : povray.advanced-users : "mirror image" of image_map used in HF function : Re: "mirror image" of image_map used in HF function Server Time
5 Jul 2024 14:36:47 EDT (-0400)
  Re: "mirror image" of image_map used in HF function  
From: Thomas de Groot
Date: 17 Apr 2008 10:19:38
Message: <48075c7a@news.povray.org>
Hmm... That explains some problems I have had in the past to get those 
things right. Thought it was my own misunderstanding.... :-)
Good testing work, Kenneth!

Thomas

"Kenneth" <kdw### [at] earthlinknet> schreef in bericht 
news:web.48013b134a8bd78778dcad930@news.povray.org...
> "Kenneth" <kdw### [at] earthlinknet> wrote:
>>
>> ...Adding rotate 180*x or scale -y corrects this (no
>> translations needed)...
>>
> I've since noticed some behavior of this image_map-to-HF-function that 
> makes the
> situation more complex than I originally thought.  While the mirror-image
> correcting trick does work, there is still an odd *scaling* problem 
> regarding
> the image_map.  If I scale the image_map smaller--in order to "tile" it 
> across
> the face of the HF--the scaling doesn't take place from the origin as it
> normally would--x=0, z=0--but rather, from x=0,z=1! Strangely, that is the
> defacto "origin" of the HF function. This causes havoc when trying to line 
> up
> an  equally-scaled image_map TEXTURE to the HF--they scale from different
> origin points!
>
> I did figure out a solution, though, that solves both the mirror image 
> problem
> AND this odd scaling. It involves putting all of the "corrections" OUTSIDE 
> of
> the HF function. (I couldn't find any other way to do it.)  Like so:
>
> height_field{
>   function 300,300{
>        pigment{
>            image_map{sys "my_image.bmp" map_type 0 interpolate 2}
>            // the HF image shows an incorrect "mirror image"
>            scale .65 // or whatever, to tile the image across the HF
>               }
>                   }
>   scale <1,-1,1> // inverts height of HF to point at -y
>   rotate 180*x // flips the HF over--corrects the mirror-imaging, and
>                //re-orients the HF height to be in the correct +y 
> direction
>   translate 1*z // moves the HF back to its proper place at the REAL 
> origin
>
>   texture{..... scale .65} // an image_map here -- flipped 90*x as usual--
>                            // will correctly line up with the HF, and
>                            // everything scales together properly.
>
>   scale ....  // additional scaling of entire HF
>   translate...
>            }
>
> I would assume that using any regular POV pigment pattern in the HF
> function--rather than an image_map there--would also exhibit these same
> problems, and need the same corrections. Gradient y does; I tried it.
>
> BTW, another odd thing here is that you can't use the ONCE keyword in the 
> HF
> function's image_map; no detail shows up at all, just a blank, flat HF. I 
> don't
> remember that happening with a normal HF.
>
> Ken W.
>
>
>
>
>


Post a reply to this message

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