POV-Ray : Newsgroups : povray.general : Omni-directional Stereo Content : Re: Omni-directional Stereo Content Server Time
3 May 2024 10:40:13 EDT (-0400)
  Re: Omni-directional Stereo Content  
From: Clodo
Date: 9 Mar 2016 09:30:00
Message: <web.56e0329d976329954e8811590@news.povray.org>
> There is a select() function which I think will work for you.

Thanks!


// user_defined camera, OSD, both eyes in one image side-by-side.
#declare ipd = 0.065;
#declare cameraLocationX = 0;
#declare cameraLocationY = 10;
#declare cameraLocationZ = 0;
camera {
      user_defined
      location {
        function { cameraLocationX + cos(select(x,(x+0.5)*2,(x*2)) * 2 * pi -
pi)*ipd/2*select(x,-1,1) }
        function { cameraLocationY }
        function { cameraLocationZ + sin(select(x,(x+0.5)*2,(x*2)) * 2 * pi -
pi)*ipd/2*select(x,-1,1) }
      }
      direction {
        function { sin(select(x,(x+0.5)*2,(x*2)) * 2 * pi - pi) * cos(pi / 2 -
(1-(y+0.5))*pi) }
        function { sin(pi / 2 - (1-(y+0.5))*pi) }
        function { cos(select(x,(x+0.5)*2,(x*2)) * 2 * pi - pi) * cos(pi / 2 -
(1-(y+0.5))*pi) }
      }
    }

Render:
https://www.clodo.it/host/images/b6175498afef1f961cfed2d2dba2c5b5df515f39.png


Post a reply to this message

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