POV-Ray : Newsgroups : povray.advanced-users : WIP: Sterograms of a cube : Re: WIP: Sterograms of a cube Server Time
29 Jul 2024 04:19:00 EDT (-0400)
  Re: WIP: Sterograms of a cube  
From: Patrick Elliott
Date: 4 Jan 2003 18:00:55
Message: <MPG.188112d0b3d696339896fb@news.povray.org>
In article <3e16f133@news.povray.org>, orp### [at] btinternetcom says...
> I've posted a couple of images - see povray.binaries.images.
> 
> It was about June time last year that I discovered how Single Image
> Sterograms ("magic eye pictures") work. You can actually make 'em out of
> plain ordinary text! I've done so with Notepad many times...
> 
> But I figured you should be able to do it with POV-Ray too - after all, it
> IS a 3D program!!!
> 
> So that's exactly what I've done today. Sorry about the resulting images
> being so dam large... you need big pixel dimensions to get a picture large
> enough to use, and lossy compression damages the 3D effect. Still, I managed
> to reduce the 2nd image to 256 colours, which seriously reduced the file
> size... I won't post any more images, just scene files. (They render real
> fast.)
> 
> ----------
> 
> The basic idea is to have similar-but-no-identical repartitions in the
> image. If you take a cube and duplicate it across the screen, then owing to
> the perspective effect, you see each cube from a slightly different angle.
> If you view the thing as a sterogram (i.e., look at it cross-eyed), you get
> a 3D effect.
> 
> However...
> 
> The 3D bit comes out backwards! (That is, the front-most part is at the
> back, with the back edges at the front. It looks really odd!) Now, I
> discovered that I can use the Reorient_Trans() macro from transforms.inc to
> rotate each cube so it faces the camera at the same angle. This results in a
> totally flat image. But if you apply that transformation TWICE - i.e.,
> _over_ compensate - you again get a 3D effect. But it's the right way round
> this time!
> 
> Sterogram #1 shows this approach.
> 
> Of course, applying the rotation twice gives you a fairly extreme 3D effect;
> the sides of the cubes look more like parallelagrams than squares. But
> still, it's very good to look at. Adding lights is a bit of a problem - the
> lights show up differently on each cube! But if you put them in a
> light_group with each cube, and transform them the same way as the cube...
> it works just fine! (That's how I did it anyway.)
> 
> BTW - I didn't realise that objects outside the light_group can still cause
> shadows! Would be nice to turn this off...
> 
> -------------
> 
> The other method is to put the camera at the origin, the object at a
> distance, and **rotate** them from side to side (i.e., rather than translate
> them). Since the camera is at the origin, they now all point at the camera
> at the same angle. If you rotate them around a point that isn't the camera,
> you get a 3D effect (negative or positive, depending on whether the point is
> in front of or behind the camera).

> Sterogram #2 shows this approach.

> Well, sort of. Actually, I rotate each cube a bit, then translate it away,
> and rotate round the camera. I think that's why the image looks "bowed". It
> does give a very slight curve to the 3D image - but not very much! I will
> try truely rotating round a different point in a bit.

> Does anyone understand what I'm chatting about? And would anyone be
> interested in me posting the scene file?

> Thanks!
> Andrew.

> PS. Can anyone here see sterograms btw? Kinda pointless if you can't :P

It should be noted that 99.99% of people can cross there eyes, but only 
about 50% can view so called 'magic eye pictures' the right way without 
developing eye strain and a case of extreme frustration. lol One book I 
saw on the subject showed some that worked the 'right' way and others 
that used crossed eyes. Other than perhaps intentionally making it 
harder, I could never understand why they used the method people have 
problems with instead.

My holly grail of single image stereogram methods is one that includes 
the option of reversing the bloody thing, so I don't have to dim my 
monitor to half normal, turn on an overhead lamp and fiddle with a sheet 
of paper to get my eyes to focus on the correct field depth. ;) 
Ironically your first attempt seems to actually do this (or so it would 
appear from your description of the result). Also.. I assume you must be 
using jpg, since you talk about the need for a large image to compensate 
for lossyness. My advice.. don't use jpg. Try PNG instead. JPG was never 
intended to handle detailed images that where not converted from photos 
(close to 3000x2000 pixels or more minimum), where the loss of detail is 
barely noticeable.

The fact that they insist on using jpg or similar lossy formats for 
digital cameras I find completely insane and it isn't all that great for 
rendering either, unless you specifically need to save space. In the case 
of stereograms it is almost certain to be lethal.


Post a reply to this message

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