POV-Ray : Newsgroups : povray.general : Using a function in a height_field declaration : Re: Using a function in a height_field declaration Server Time
23 Jun 2024 12:49:04 EDT (-0400)
  Re: Using a function in a height_field declaration  
From: Kenneth
Date: 24 Feb 2023 14:25:00
Message: <web.63f90dfc43a1dd889b4924336e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> >
> > If you mean that the 'center' of the sine wave circle is
> > not 'at the origin' but at z=1 instead, that could be due to a long-standing
> > problem with how functions are kind of mirror-reversed when used in a
> > height_field...
> BTW: That old problem had strange effects: no only of the z effect of the
> function being reversed to '-z', but also x to -x. It was -- is? --a
> 'double-reversal' mirror effect...with the 'origin' of the function moved to
> z=1, not at <0,0,0>.

Now that I have been playing around again with this function-to-HF mess, I see
that the mirror-reversal flaw is only in z in the created HF, not both x and z
like I had thought for years. This why my 'brute-force' fix works successfully:

     function 500,500{somb(x,y,z)}
     scale <1,1,-1>
     translate <0,0,1>

...as does William P's trick:
            somb(x, (1-y), z)

These two methods seem to be the only *reliable* ways to fix it. I mention this
again because, for years, I had used an IMAGE_MAP-to-function as my 'standard
candle' tester-- and there is yet another way to fix *its* reversal:

#declare somb =
pigment{image_map{--my image--}
scale <1,-1,1>}

So I thought that this 3rd method worked for ALL patterns-- but it does not.
Other pigment/pattern functions show...'varying' results:
ONION does not reverse.
GRADIENT X+Y does reverse, or so it seems.
GRANITE does reverse-- in some way-- but the visual result is not the same as
the two 'reliable' methods. The same goes for HEXAGON.
SPIRAL1/SPIRAL2 appears to reverse in *x*, not z (!)

I would assume that there is some logic to this mish-mash of results, but I
don't yet grasp it.

Post a reply to this message

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