POV-Ray : Newsgroups : povray.advanced-users : WIP: Sterograms of a cube : WIP: Sterograms of a cube Server Time
29 Jul 2024 04:25:15 EDT (-0400)
  WIP: Sterograms of a cube  
From: Andrew Coppin
Date: 4 Jan 2003 09:35:31
Message: <3e16f133@news.povray.org>
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


Post a reply to this message

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