POV-Ray : Newsgroups : povray.newusers : rendering stereo pairs in povray? Server Time
29 Jul 2024 16:24:51 EDT (-0400)
  rendering stereo pairs in povray? (Message 1 to 4 of 4)  
From: spl
Subject: rendering stereo pairs in povray?
Date: 19 Sep 2005 10:55:00
Message: <web.432ed0573a4dae0bb279c3b00@news.povray.org>
Is there any intrinsic ability in povray that I've missed in my reading that
supports rendering stereo pairs?  I can, of course, twiddle the look_from
and look_at parameters appropriately but I was hoping that there might be
some command or macro that I've managed to miss in my research.

Thanks


Post a reply to this message

From: PM 2Ring
Subject: Re: rendering stereo pairs in povray?
Date: 19 Sep 2005 12:15:01
Message: <web.432ee2b51d9357d37ac32c540@news.povray.org>
"spl" <nomail@nomail> wrote:
> Is there any intrinsic ability in povray that I've missed in my reading that
> supports rendering stereo pairs?

No, but there is an unofficial patched version of POV 3.5 called StereoPOV
at

http://stereopov.ichthyostega.de/

It renders both views simultaneously, for efficiency. Sometimes, a stereo
scene will only take 10% to 20% longer than the monoscopic view. It can do
stereo-aware antialiasing which is very efficient and allows you to use
jitter in antialias, which is normally a no-no for stereo pairs.

However, StereoPOV rotates the views, which is not the best way to make
stereo pairs. Still, I find StereoPOV a handy program to have for quick 3D
work.

> I can, of course, twiddle the look_from
> and look_at parameters appropriately but I was hoping that there might be
> some command or macro that I've managed to miss in my research.

I leave the camera location & look_at vectors alone and translate the camera
sideways as the last statement in the camera block. Assuming the camera is
looking straight ahead parallel to the z axis, then (according to the
literature) that if the distance from the camera to the centre of the scene
is D, then translate -0.014*D*x for the left eye & 0.014*D*x for the right
eye view.

I use NetPBM to join the pair into a .pns or .jps for flexibility in 3D
viewing.

Here's a stereo version of my RSOCP post, for a somewhat condensed example:

//--------------------------------------------------------------

//POV-Ray 3.1+ Scene File. Classic Pickover shell.
global_settings{max_trace_level 99 assumed_gamma 1}
#declare N=99;#declare K=.75;#declare A=-2;#declare D=(11/3-A)/N;
#declare B=.15;#declare C=.35/B;union{#declare I=1;#while(I<=N)
#declare T=I/N;#declare TH=A*2*pi;#declare R=B*exp(A*K);
sphere{<R*cos(TH),R*sin(TH),C*R>,R pigment{rgb<T,.6,1-T*T>}
finish{phong .7 reflection {0,1}}}#declare I=I+1;#declare A=A+D;
#end rotate x*9 translate<0,3,9>}light_source{<2,4,-8>rgb 1.3}
plane{y,-9 pigment{checker rgb 0 rgb 1 scale 5 rotate 45*y}
finish{reflection 1 ambient 0}rotate -x*35}
camera{translate x*0.014*5}

//--------------------------------------------------------------

And here's the .pns file:

http://i2.photobucket.com/albums/y43/PM2Ring/ShellQuick2LR.png

I've posted a few more stereo pairs in p.b.i over the last few months, but
most of them were just done in StereoPOV.

I love stereo pairs. I'm amazed that more POV people aren't doing them.


Post a reply to this message

From: spl
Subject: Re: rendering stereo pairs in povray?
Date: 19 Sep 2005 12:50:01
Message: <web.432eebb21d9357d3b279c3b00@news.povray.org>
"PM 2Ring" <nomail@nomail> wrote:
> I leave the camera location & look_at vectors alone and translate the camera
> sideways as the last statement in the camera block. Assuming the camera is
> looking straight ahead parallel to the z axis, then (according to the
> literature) that if the distance from the camera to the centre of the scene
> is D, then translate -0.014*D*x for the left eye & 0.014*D*x for the right
> eye view.

Do I understand correctly then that if the camera is tilted, this won't
work?

How was the 0.014 constant derived?  If it's in the literature, can you
point me at a suitable reference?

Thanx.


Post a reply to this message

From: PM 2Ring
Subject: Re: rendering stereo pairs in povray?
Date: 19 Sep 2005 23:10:00
Message: <web.432f7d5b1d9357d3ad93754b0@news.povray.org>
"spl" <nomail@nomail> wrote:
> "PM 2Ring" <nomail@nomail> wrote:
> > I leave the camera location & look_at vectors alone and translate the camera
> > sideways as the last statement in the camera block. Assuming the camera is
> > looking straight ahead parallel to the z axis, then (according to the
> > literature) that if the distance from the camera to the centre of the scene
> > is D, then translate -0.014*D*x for the left eye & 0.014*D*x for the right
> > eye view.

I should have mentioned that the viewing distance is affected by the camera
direction vector and angle.

> Do I understand correctly then that if the camera is tilted, this won't
> work?

It will work ok if the camera is tilted vertically, but not horizontally,
because that would give different distances for the two eyes. The simple
way to handle this problem is to give the camera location & look_at vectors
the same x value, and rotate the camera (or the whole scene) to give the
desired viewing angle.

> How was the 0.014 constant derived?  If it's in the literature, can you
> point me at a suitable reference?

Here you go:

http://www.cs.wpi.edu/~matt/courses/cs563/talks/stereohtml/stereo.html


Post a reply to this message

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