POV-Ray : Newsgroups : povray.binaries.images : Spherical displacement map : Re: Spherical displacement map Server Time
23 Apr 2024 17:57:21 EDT (-0400)
  Re: Spherical displacement map  
From: Bald Eagle
Date: 21 Jul 2020 20:25:01
Message: <web.5f178739b206640bfb0b41570@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 21/07/2020 à 12:58, Bald Eagle a écrit :

> > I'm also curious as to why I got I got a core dump with no clipping, and no core
> > dump with half-clipping, if the domain input was the underlying issue.

Can you test this in POV-Ray and HGpovray38 to see if you get an error?

> > And I'm not even sure that the domain was out range now that we're back into
> > this again.

> > (I mean, can y ever exceed the vector length to give a quotient exceeding
> > unity?)

I did a quick spreadsheet calculation.   Aside from some numerical/binary
representation/rounding it shouldn't.


>... there is a
> preference for the haversine formula instead of basic acos.

Nice.   That was an interesting read - thanks!

> For your computation of latitude, you can use the complemented angle and
> asin instead, then complement the result, using the sign of y as final
> update.
>
> The loss of precision near 0 is far "better" than the loss of precision
> near 1, due to representation of floating point numbers.
>
> #declare Latitude = pi/2 - asin( sqrt( x*x+z*z)/sqrt(x*x+y*y+z*z) );
> #if (y<0)
> #declare Latitude = -1 * Latitude;
> #end


I dabbled with all of that.
It was "wrong" at first - since sin is opposite over hypotenuse, and y would be
the cathetus opposite the angle, it should be y/vlength instead of sqrt(
x*x+z*z)/vlength ... yes?

Which is kinda just what I had before, only using asin with a 90-deg phase
shift.

And I got the exact same result.
Which was disappointing at first, but which I recognized held promise.

So, after coffee, shower, and kicking back for a bit (it was NOT a nap...) I
realized that if, perhaps, it wasn't the math - then it had to be what the math
was mapping.
[TdG will back me up on the merits of considering these things behind closed
eyes.]
If the image was getting mapped correctly, but there were extra pixels in the
image...   And sure enough, comparing the elevation map to a different image map
showed that there is indeed a strip of pixels where there ought be none.

Damn it.

Stupid assumptions...

"We shall not cease from exploration
And the end of all our exploring
Will be to arrive where we started
And know the place for the first time...."

Thanks for spinning me around in this circle one more time, Jerome.   :)

Now maybe I can make some actual meaningful progress...


Post a reply to this message

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