POV-Ray : Newsgroups : povray.general : Debugging help : Re: Debugging help Server Time
26 Apr 2024 11:18:42 EDT (-0400)
  Re: Debugging help  
From: Bald Eagle
Date: 23 May 2017 07:45:01
Message: <web.5924204b1ef603fec437ac910@news.povray.org>
"Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
> "omniverse" <omn### [at] charternet> wrote:
> > clipka <ano### [at] anonymousorg> wrote:
> > >
> > > My spontaneous guess would be that the use of `acos` here might be to
> > > blame, as it will only return values in the range from -90 to +90
> > > degrees, losing information about the quadrant. Maybe try rephrasing
> > > that as an expression satisfying the form `atan(A/B)`, and then use
> > > `atan2(A,B)` instead to make sure you get the quadrant right.
> > >
> > > I haven't fully thought it through, but I think the following should do
> > > the trick:
> > >
> > >     #local wall_th = degrees(atan2(wall_vec.x, wall_vec.z));

I was busy getting my jaw drilled out, otherwise I might have had the time and
energy to dabble with this.

If I was going to dabble with this, I'd likely start by making a separate scene
that does nothing but graph the vectors that wall_th spits out over the full 0
to tau range.  Or at least churn out a listing of the values to the #debug
stream.

Then I'd see what the macro transforms that into.

I've seen this type of problem before in my own scenes, but it's usually some
type of thing where I'm turning it the wrong way, or I'm 90 degrees off, or
both.  So I definitely think Christoph's insight into using atan2 so that the
quadrant information is preserved is a great idea.


Post a reply to this message

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