POV-Ray : Newsgroups : povray.tools.general : Norbert Kern's 'Position-Finder' code-- redux : Re: Norbert Kern's 'Position-Finder' code-- redux Server Time
23 Apr 2024 20:19:24 EDT (-0400)
  Re: Norbert Kern's 'Position-Finder' code-- redux  
From: Kenneth
Date: 19 Sep 2018 01:40:01
Message: <web.5ba1e030bb085d6ca47873e10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Nice job, Walker.   :)

Thanks! I've been *slaving* over this code, day after day. (But I'm still
irritated that I couldn't get it completely worked out. I haven't given up yet!)
You may have already guessed that my recent post about matrix use and transforms
was a last-ditch effort to solve the remaining flaws in this code.

>
> I tried the macro with a point not on the 'surface' and just got the macro
> message - I'm wondering if instead the macro ought to return a normalized vector
> indicating the direction from the camera to that selected pixel.
>
> Then you could translate the object to the camera position, and then some
> multiple along that vector, so that you could place things "in the air".

Like you, I've been wondering how to get such 'in air' positions, which didn't
seem possible with the way the code was constructed. But I tried some more
tests, per your suggestion (going about it the wrong way, naturally), and
realized that your PLANE idea wouldn't need such an arrow...
>
> I suppose a vertical semi-transparent plane would work just as well.
>

That is a brilliant idea! It didn't occur to me at all. And the plane can be
positioned (and rotated if necessary) to get any in-air position anywhere. Add
this code into the SURFACE object-union (and comment it out if it's not
needed)...

plane{z,0  // a transparent plane, for picking positions IN SPACE
     texture {
  pigment{
     average
     pigment_map{
     [0.6 gradient x frequency 8
          color_map{
                  [.07 rgb -.3]
                  [.07 rgbt <1,0,0,.7>]
                  }
     ]
     [0.6 gradient y frequency 8
         color_map{
                  [.07 rgb -.3]
                  [.07 rgbt <1,0,0,.7>]
                  }
     ]
                }
       }
  finish {ambient 0 emission .5 diffuse 0}
     }
  rotate 37   // whatever you want
  translate -1.3*z // wherever you want to put it
    }

BTW: When an in-air POSITION is returned, it's probably best to ignore the found
ROTATION-- as it has no real meaning re: the normal traced on that 'artificial
plane'.


Post a reply to this message

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