POV-Ray : Newsgroups : povray.binaries.images : Single Parse Stereoscopic? Server Time
12 Oct 2026 22:44:49 EDT (-0400)
  Single Parse Stereoscopic? (Message 1 to 19 of 19)  
From: Nekar Xenos
Subject: Single Parse Stereoscopic?
Date: 19 Nov 2007 03:36:06
Message: <47414af6@news.povray.org>
Here's a different approach to stereoscopic imaging without having to parse
twice or use the clock setting. I don't know enough about lenses but I think
someone might be able to tweak this to work correctly. I used a repeated
spherical camera normal to get 2 images.

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

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 5
}

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


camera {
  right x*image_width/image_height
  location  <0.0, 0.5, -4.0>
  look_at   z

          normal {spherical /*scale <10,10,01>*/ translate <.5,.5,-.5>  //
pattern modifier
          warp {
                    repeat x           // repeat direction
                }
                translate -.5*y
                scale <.7,.7,10>
                  //
          }

}


sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

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

plane {               // checkered floor
  y, -1
  texture
  {
    pigment {
      checker
      color rgb 1
      color blue 1
      scale 0.5
    }
    finish{
      diffuse 0.8
      ambient 0.1
    }
  }
}

sphere {              // reflective sphere
  0.0, 1
  texture {
    pigment {
      color rgb <0.8,0.8,1.0>
    }
    finish{
      diffuse 0.3
      ambient 0.0
      specular 0.6
      reflection {
        0.8
        metallic
      }
      conserve_energy
    }
  }
}

//-----------------------------------------------------------------
-- 
-Nekar Xenos-


Post a reply to this message


Attachments:
Download 'Stereoscopic.png' (42 KB)

Preview of image 'Stereoscopic.png'
Stereoscopic.png


 

From: sooperFoX
Subject: Re: Single Parse Stereoscopic?
Date: 19 Nov 2007 07:45:00
Message: <web.474184b5f2015f4b943b35b60@news.povray.org>
Hi Nekar,

I am not a photographer (nor very advanced with pov camera) so I could not give
you any _technical_ advice but I think for this to work you'll either need to
move the camera *waaay* back and use a narrow camera angle, or use a different
type of projection because the radial angular perspective distortion ruins the
effect somewhat.

When looking at the image "wall-eyed" I notice that there is a little depth
information near the centre of the image (i.e. it works pretty well for the
sphere and its reflection), but as you get further out to the edges (and
particularly noticeable on the horizontal lines), the curvature distortion is
misaligned between the two images and the brain really struggles to find a
correlation on the two halves, and it becomes very 'distracting'.

I think it is perhaps because of the symmetrical effect in the curvature (it
looks like the distortion is 'mirrored'). If you could find a way to not mirror
the warp/normal but instead clone it from one side of the vertical axis to the
other (-x to +x) that might work. I'm sorry that I don't know enough about the
warp or the spherical pattern to actually help you HOW to do this. This is all
just my observation.

Frankly I am very impressed that it works! I think your theory is more than
halfway there and with some fine-tuning could have application.


Have you thought about modelling how a real stereoscopic camera might work? I.e.
four planar mirrors, two for each 'eye', angled just right so as to split and
spatially separate the viewport down the middle?

E.g. one half of the rays would hit the first mirror and bounce off to the left,
then get reflected back to the intended focal point, only their origin would be
slightly left of the camera's location, and the other half would hit the third
mirror and bounce off to the fourth, and be reflected back to the same focal
point, this time from the right. You should be able to use some geometry to
figure out the angle required for each of the two mirrors on one side, then
just flip it for the other side. Or, maybe you wanted to avoid this altogether
and try another method! :)


Anyway I hope I have helped in some small way, if you're not totally confused by
my non-technical understanding of this... :)


sooperFoX


"Nekar Xenos" <nek### [at] gmailcom> wrote:
> Here's a different approach to stereoscopic imaging without having to parse
> twice or use the clock setting. I don't know enough about lenses but I think
> someone might be able to tweak this to work correctly. I used a repeated
> spherical camera normal to get 2 images.


Post a reply to this message

From: sooperFoX
Subject: Re: Single Parse Stereoscopic?
Date: 19 Nov 2007 08:25:01
Message: <web.47418e7ff2015f4b943b35b60@news.povray.org>
I was just thinking about this some more.. I think it has to do with the
spherical normal to begin with. It looks like the 'splitting' of the viewport
is happening OK (thanks to the warp I presume) but the spherical nature of the
normal is what is causing the distortion.

What if you tried a gradient, something like (forgive my syntax, I don't have
POV in front of me)


gradient x
normal_map {
[0.0 <1, -1>]
[0.5 <0, -1>]
[0.5 <0,  1>]
[1.0 <1,  1>]
}
translate -0.5*x


...or similar. I have absolutely no idea how you would focus something like that
though! Perhaps some clever scaling.. hehehe

Just throwin' it out there.


sooperFoX


P.S. the more I think about it, the more it seems like just trying to find a
"short-cut" for the method I described at the end of my last post.. maybe
prisms instead of mirrors though.. hmmm


"sooperFoX" <bon### [at] gmailcom> wrote:
> ...the radial angular perspective distortion ruins the
> effect somewhat..

--->8--- snip


Post a reply to this message

From: Alain
Subject: Re: Single Parse Stereoscopic?
Date: 19 Nov 2007 11:22:53
Message: <4741b85d$1@news.povray.org>
Nekar Xenos nous apporta ses lumieres en ce 2007/11/19 03:36:
> Here's a different approach to stereoscopic imaging without having to parse
> twice or use the clock setting. I don't know enough about lenses but I think
> someone might be able to tweak this to work correctly. I used a repeated
> spherical camera normal to get 2 images.
> 
> //----------------------------------------------------
> 
> #include "colors.inc"
> 
> global_settings {
>   assumed_gamma 1.0
>   max_trace_level 5
> }
> 
> // ----------------------------------------
> 
> 
> camera {
>   right x*image_width/image_height
>   location  <0.0, 0.5, -4.0>
>   look_at   z
> 
>           normal {spherical /*scale <10,10,01>*/ translate <.5,.5,-.5>  //
> pattern modifier
>           warp {
>                     repeat x           // repeat direction
>                 }
>                 translate -.5*y
>                 scale <.7,.7,10>
>                   //
>           }
> 
> }
> 
> 
> sky_sphere {
>   pigment {
>     gradient y
>     color_map {
>       [0.0 rgb <0.6,0.7,1.0>]
>       [0.7 rgb <0.0,0.1,0.8>]
>     }
>   }
> }
> 
> light_source {
>   <0, 0, 0>            // light's position (translated below)
>   color rgb <1, 1, 1>  // light's color
>   translate <-30, 30, -30>
> }
> 
> // ----------------------------------------
> 
> plane {               // checkered floor
>   y, -1
>   texture
>   {
>     pigment {
>       checker
>       color rgb 1
>       color blue 1
>       scale 0.5
>     }
>     finish{
>       diffuse 0.8
>       ambient 0.1
>     }
>   }
> }
> 
> sphere {              // reflective sphere
>   0.0, 1
>   texture {
>     pigment {
>       color rgb <0.8,0.8,1.0>
>     }
>     finish{
>       diffuse 0.3
>       ambient 0.0
>       specular 0.6
>       reflection {
>         0.8
>         metallic
>       }
>       conserve_energy
>     }
>   }
> }
> 
> //-----------------------------------------------------------------
> 
Try with this camera:

camera {
   right x*image_width/image_height/3 //Otherwise, the sphere is
//stretched verticaly, a lot!
   location  <0.0, 0.5, -4.0>
   look_at   z

           normal {cylindrical 0.5/*scale <10,10,01>*/ translate <.5,.5,-.5> 
//pattern modifier
           warp {
                     repeat x           // repeat direction
                 }
                 translate -.5*y
                 scale <.7,.7,10>
                   //
           }
   angle 60 // to keep the sphere images from drifting apart
}

This camera get rid of the spherical distortion.
Good for parallel vewing.

-- 
Alain
-------------------------------------------------
Grandchildren are God's reward for not killing your own.


Post a reply to this message

From: Leef me
Subject: Re: Single Parse Stereoscopic?
Date: 19 Nov 2007 15:45:01
Message: <web.4741f3fcf2015f4b2a7b15450@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> Nekar Xenos nous apporta ses lumieres en ce 2007/11/19 03:36:
> > Here's a different approach to stereoscopic imaging without having to parse
> > twice or use the clock setting. I don't know enough about lenses but I think
> > someone might be able to tweak this to work correctly. I used a repeated
> > spherical camera normal to get 2 images.
>

> > camera {
> >   right x*image_width/image_height
> >   location  <0.0, 0.5, -4.0>
> >   look_at   z
> >
> >           normal {spherical /*scale <10,10,01>*/ translate <.5,.5,-.5>  //
> > pattern modifier
> >           warp {
> >                     repeat x           // repeat direction
> >                 }
> >                 translate -.5*y
> >                 scale <.7,.7,10>
> >                   //
> >           }
> >
> > }




> >
> > //-----------------------------------------------------------------
> >
> Try with this camera:
>
> camera {
>    right x*image_width/image_height/3 //Otherwise, the sphere is
> //stretched verticaly, a lot!
>    location  <0.0, 0.5, -4.0>
>    look_at   z
>
>            normal {cylindrical 0.5/*scale <10,10,01>*/ translate <.5,.5,-.5>
> //pattern modifier
>            warp {
>                      repeat x           // repeat direction
>                  }
>                  translate -.5*y
>                  scale <.7,.7,10>
>                    //
>            }
>    angle 60 // to keep the sphere images from drifting apart
> }
>
> This camera get rid of the spherical distortion.
> Good for parallel vewing.
>
> --
> Alain
> -------------------------------------------------
> Grandchildren are God's reward for not killing your own.


I can't make any useful suggestions, I just complain ;)

In the upper picture
Alains' version seems to stretch the spheres toward the center
     ( >  |  < )
the spheres are curves on the outside edges, but stretched toward the center.

In the lower picture
Nekar's version seems to compress the sphere from the top


Leef_me


Post a reply to this message


Attachments:
Download 'stereo1&2.jpg' (142 KB)

Preview of image 'stereo1&2.jpg'
stereo1&2.jpg


 

From: William Tracy
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 00:58:10
Message: <47427772$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your images keep giving me the feeling of the "cameras" being too far apart.

Anyway, here's someone who's successfully done what you're trying to do:
http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.jpg
http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.txt

- --
William Tracy
afi### [at] gmailcom -- wtr### [at] calpolyedu

You know you've been raytracing too long when you install voice
recognition software to use in your script editor and a month later find
yourself using a tape recorder to speak for you because your voice is shot.
    -- Ken Tyler
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHQndxKrVIcTMekC8RAvVMAJ989l7xbCpwbMkkbYIOY6xe7+WGugCeNrda
zPYAW5iPAgwUBTbZEvRC9ts=
=8kRx
-----END PGP SIGNATURE-----


Post a reply to this message

From: Nekar Xenos
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 01:15:47
Message: <47427b93@news.povray.org>
"Leef_me" <nomail@nomail> wrote in message 
news:web.4741f3fcf2015f4b2a7b15450@news.povray.org...

> I can't make any useful suggestions, I just complain ;)
>
> In the upper picture
> Alains' version seems to stretch the spheres toward the center
>     ( >  |  < )
> the spheres are curves on the outside edges, but stretched toward the 
> center.
>
> In the lower picture
> Nekar's version seems to compress the sphere from the top
>
>
> Leef_me
>
>
changing the scale in the camera to <.8,1,10>"looks a lot better now

-- 
-Nekar Xenos-


Post a reply to this message


Attachments:
Download 'Stereoscopic.png' (96 KB)

Preview of image 'Stereoscopic.png'
Stereoscopic.png


 

From: scott
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 08:44:54
Message: <4742e4d6$1@news.povray.org>
> Anyway, here's someone who's successfully done what you're trying to do:
> http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.jpg
> http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.txt

Yeh, I was going to suggest that method too, we had a real digital camera 
lying around here somewhere with an attachment like that on it, specifically 
for taking photos to be shown on a 3D display.


Post a reply to this message

From: Nekar Xenos
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 09:35:47
Message: <4742f0c3@news.povray.org>
"scott" <sco### [at] laptopcom> wrote in message 
news:4742e4d6$1@news.povray.org...
>> Anyway, here's someone who's successfully done what you're trying to do:
>> http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.jpg
>> http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.txt
>
> Yeh, I was going to suggest that method too, we had a real digital camera 
> lying around here somewhere with an attachment like that on it, 
> specifically for taking photos to be shown on a 3D display.
>
This is very good but if the intent is for animation camera normal is 
faster, so I would like to stick to the camera normal.


-- 
-Nekar Xenos-


Post a reply to this message

From: Alain
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 09:58:03
Message: <4742f5fb$1@news.povray.org>
Nekar Xenos nous apporta ses lumieres en ce 2007/11/20 09:35:
> "scott" <sco### [at] laptopcom> wrote in message 
> news:4742e4d6$1@news.povray.org...
>>> Anyway, here's someone who's successfully done what you're trying to do:
>>> http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.jpg
>>> http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.txt
>> Yeh, I was going to suggest that method too, we had a real digital camera 
>> lying around here somewhere with an attachment like that on it, 
>> specifically for taking photos to be shown on a 3D display.
>>
> This is very good but if the intent is for animation camera normal is 
> faster, so I would like to stick to the camera normal.
> 
> 
Try this one:

camera {
   right x*image_width/image_height
   location  <0.0, 0.5, -8.0>
   look_at   z

           normal {marble -0.8 translate <.5,.5,-.5>  }
   angle 60

}

This get rid of the distortions as marble have a triangular shape. Also, it's 
repeating, so you no longer need the repeat warp. It act like a pair of 
achromatic prisms instead as a pair of shifted lences.

-- 
Alain
-------------------------------------------------
Fundamentalism: If shit happens to a televangelist, it's okay.


Post a reply to this message

From: Bill Pragnell
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 10:40:01
Message: <web.4742ff6cf2015f4b731f01d10@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> Try this one:
[snip camera]
> This get rid of the distortions as marble have a triangular shape. Also, it's
> repeating, so you no longer need the repeat warp. It act like a pair of
> achromatic prisms instead as a pair of shifted lences.

That's much better, the previous versions were all slightly fuzzy and gave me a
bit of a headache. This new camera does the job much more effectively; the
composite image is much sharper.

When I render it, there is a glass-like vertical boundary at the sides of each
image - what causes this?

Cross-Eyed Bill


Post a reply to this message

From: Leef me
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 13:20:00
Message: <web.474324bcf2015f4b2a7b15450@news.povray.org>
"Bill Pragnell" <bil### [at] hotmailcom> wrote:
> Alain <ele### [at] netscapenet> wrote:
> > Try this one:
> [snip camera]
> > This get rid of the distortions as marble have a triangular shape. Also, it's
> > repeating, so you no longer need the repeat warp. It act like a pair of
> > achromatic prisms instead as a pair of shifted lences.
>
> That's much better, the previous versions were all slightly fuzzy and gave me a
> bit of a headache. This new camera does the job much more effectively; the
> composite image is much sharper.
>
> When I render it, there is a glass-like vertical boundary at the sides of each
> image - what causes this?
>
> Cross-Eyed Bill


As Bill said, much better.
And then I added another object for perspective, see below.
What does this object do to the effect?

Also, is there a way to use screen.inc to add a mask around the view,
effectively hiding the abberation that Bill noticed?

Leef_me

//-------------------------------------------------
cylinder {
  0*y,  15*y,  .5
  // open
  texture {
    pigment {
      color rgb <0.8,0.8,1.0>
    }
    finish{
      diffuse 0.3
      ambient 0.0
      specular 0.6
      reflection {
        0.8
        metallic
      }
      conserve_energy
    }
  }
  translate <-8,0,50>
}
//-------------------------------------------------


Post a reply to this message

From: John VanSickle
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 14:03:30
Message: <47432f82@news.povray.org>
William Tracy wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Your images keep giving me the feeling of the "cameras" being too far apart.
> 
> Anyway, here's someone who's successfully done what you're trying to do:
> http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.jpg
> http://www.irtc.org/ftp/pub/stills/1998-02-28/dpatrol.txt

I prefer putting the right view on the left and vice-versa, because the 
eye-cross method is easier for me.  If the images are greater than a 
certain width, the other way is even more difficult to manage.

Regards,
John


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 14:55:01
Message: <web.47433b90f2015f4bc150d4c10@news.povray.org>
I wrote a macro many years ago (2001) that uses mirrors to create a stereoscopic
effect to some success.

Here is a modern render using it.

-tgq


Post a reply to this message


Attachments:
Download 'stereosample.jpg' (188 KB)

Preview of image 'stereosample.jpg'
stereosample.jpg


 

From: Leef me
Subject: Re: Single Parse Stereoscopic?
Date: 20 Nov 2007 21:10:01
Message: <web.4743928ff2015f4b2a7b15450@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> I wrote a macro many years ago (2001) that uses mirrors to create a stereoscopic
> effect to some success.
>
> Here is a modern render using it.
>
> -tgq

VERY NICE.

Would you be willing to share your work with the rest of the class?

Leef_me

(muttering to self)     very nice indeed...


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Single Parse Stereoscopic?
Date: 21 Nov 2007 08:40:02
Message: <web.4744352ef2015f4bc150d4c10@news.povray.org>
"Leef_me" <nomail@nomail> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> > I wrote a macro many years ago (2001) that uses mirrors to create a stereoscopic
> > effect to some success.
> >
> > Here is a modern render using it.
> >
> > -tgq
>
> VERY NICE.
>
> Would you be willing to share your work with the rest of the class?
>
> Leef_me
>
> (muttering to self)     very nice indeed...

Certainly.  I thought I had posted it way back then, but I can seem to find it
on the boards now...

Anyways, I'll post the macro file and sample scene file in p.b.sf to be picked
apart.

The sample scene file doesn't use the my HDRI light system as the posted image
does as people may not have it or may not have megaPOV installed for it.  If
you want to use it, find it in the p.b.sf group
(http://news.povray.org/povray.binaries.scene-files/message/%3Cweb.46488bca4e05d400c150d4c10%40news.povray.org%3E/#%3Cw
eb.46488bca4e05d400c150d4c10%40news.povray.org%3E)

For the macro, you set the number of views you want and the spacing of the
cameras.  The camera viewing angle is calculated from this.  (To get a wider
view, you have to spac the cameras further apart, not further away).
This macro is not particularly suited to large scenes as the object or scene
being viewed has to be declared as a single object to be passed to the macro.
The macro works by placing the camera at the look_at location, and surrounding
it with mirrors reflecting directly back at it with appropriate spacing based
on the variables.  This means that the camera is potentially inside the viewing
object, which is why it needs to be declared and given a "no_image" flag so the
camera can see out of it.

Anyways, have a look and make any adjustments or changes as needed.

-tgq


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Single Parse Stereoscopic?
Date: 21 Nov 2007 14:35:00
Message: <web.47448819f2015f4bc150d4c10@news.povray.org>
I ran a nice high quality render using my MarioShrooms to share.

-tgq


Post a reply to this message


Attachments:
Download 'stereomario(shrooms).jpg' (190 KB)

Preview of image 'stereomario(shrooms).jpg'
stereomario(shrooms).jpg


 

From: Leef me
Subject: Re: Single Parse Stereoscopic?
Date: 21 Nov 2007 16:25:01
Message: <web.4744a10df2015f4b2a7b15450@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "Leef_me" <nomail@nomail> wrote:
> > "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> > > I wrote a macro many years ago (2001) that uses mirrors to create a stereoscopic
> > > effect to some success.
> > >
> > > Here is a modern render using it.
> > >
> > > -tgq
> >
> > VERY NICE.
> >
> > Would you be willing to share your work with the rest of the class?
> >
> > Leef_me
> >
> > (muttering to self)     very nice indeed...
>
> Certainly.  I thought I had posted it way back then, but I can seem to find it
> on the boards now...
>
> Anyways, I'll post the macro file and sample scene file in p.b.sf to be picked
> apart.


>
> Anyways, have a look and make any adjustments or changes as needed.
>
> -tgq


Thank you Teacher.
By the way, I was looking back at old TGQ posts for the elusive macro and
discovered this exchange
http://news.povray.org/./povray.general/thread/%3C451300bb%40news.povray.org%3E/

Makes me think of gifts for friends. It is interesting idea that your macro
"surrounding it with mirrors". Maybe a full 3d effect is possible.

Leef_me


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Single Parse Stereoscopic?
Date: 22 Nov 2007 13:55:01
Message: <web.4745cf58f2015f4bc150d4c10@news.povray.org>
The images and macro I've done so far is for parallel viewing which has some
limitations compared to cross viewing.  Unless you are capable of diverging
your eyes, the actual image spacing needs to be smaller than your actual eye
spacing, which means the object has to be smaller.

For parallel viewing, it is quite simple to set up with mirrors.  You can either
do it like in the other post with diverging mirrors, or the way I did it.  I
think it is possible to do cross-eyed with mirrors, but it would be much more
complex with more maths and mirros to get the images to cross over.  However,
megaPOV has a camera_view pigment.  With this, you just look orthagonally at a
couple of boxes, and map the viewing mirrors as pigments on them.  Not sure if
this feature is to get extended to POV4 (or maybe 3.7...), but it is very
useful for doing single pass stereoscopics (amongst other things).  Without
this, you caould always write a 3-part animation, one pass for each eye, then
the third pass to combine them.

Here is a sample cross-eye render pair to try out.  If you are interested, I can
post the macro for the camera, it is very simple and very simple to implement.
You can also use it directly in a scene, as you don't need to predeclare and
pass the viewing objects.

-tgq


Post a reply to this message


Attachments:
Download 'stereosamplex1.jpg' (139 KB)

Preview of image 'stereosamplex1.jpg'
stereosamplex1.jpg


 

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