POV-Ray : Newsgroups : povray.advanced-users : stereographic projection : Re: stereographic projection Server Time
5 Jul 2024 15:34:28 EDT (-0400)
  Re: stereographic projection  
From: Mark Weyer
Date: 7 Feb 2008 11:05:00
Message: <web.47ab2be38ae02ef3fddaa4670@news.povray.org>
> #declare R=1;//Radius of projected sphere
> #declare d=2;//distance from center of sphere
> camera {
>   user_defined
>   location{
>     function{(u-1/2)*2*(R+d)}
>     function{d}
>     function{(v-1/2)*2*(R+d)}
>   }
>   direction{
>     function{-(u-1/2)*2}
>     function{-1}
>     function{-(v-1/2)*2}
>   }
> }

I don't think this will do. Basically, this doubles the tangent of the angle,
not the angle itself.

But if that is the syntax for user-defined cameras, the following should work:

#declare Width = ...  // corresponds to length of right in other camera types
#declare Height = ... // corresponds to length of up in other camera types
camera {
  user_defined
  location {function {0} function {0} function {0}}
  direction {
    function {tan (atan((u-1/2)*Width) * 2)}
    function {1}
    function {tan (atan((v-1/2)*Height) * 2)}
  }
}

  Mark Weyer


Post a reply to this message

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