Page 1 of 1

3D Stereoscopic Sample (Side-By-Side for your fancy HDTV)

Posted: Sun Feb 09, 2014 4:23 pm
by b.hellmark
This is a quick sample of an implementation of stereoscopic 3D within Ren'Py.

To experience this in true 3D you will need to hook up your laptop or computer to a 3D capable TV-set that can manually switch to "Half Side-By-Side"-mode (left images first, or parallel viewing). Or else, you will just see everything double 8)

The script includes the necessary commands (hopefully commented understandable) to create the 3D effect with 2D images by positioning images on different parallaxes (for further information see here: http://www.reallusion.com/iclone/Help/i ... Vision.htm).

With the help of this script/sample you can add a 2D/3D-Diorama-effect to your existing 2D-artwork (sprites, background), similar to those paperclip creations, e.g. seen here: http://papermau.blogspot.co.at/2013/03/ ... soyou.html.

You don't have to create any special artwork for this to be used, as the script will semi-automatically create seperate views for the left and right eye from existing "mono"-artwork.

Although if you like, you can also use precreated stereo images as background artwork or for your sprites. You may even include stereoscopic videos.

Update: Version 0.2 (02-12-2014):
  • Text display has been fixed. You can now enter dialogue as usual, it will appear simultaneously on the left and right.
  • I've defined two functions which allow you to position different elements (background, sprites) on different levels of depth:

    Code: Select all

    def bg3d(image,parallax):
            return im.Composite((1280, 720),(0, 0), im.Scale(im.Crop(im.Scale(image,1280+parallax,720), (parallax, 0, 1280-parallax,720)), 640,720),(640,0), im.Scale(im.Crop(image, (0, 0, 1280-parallax,720)), 640, 720))
        def sprite3d(image,width,height,parallax,crop):
            return im.Composite((0.5*width*height/(height-crop)+640+parallax, height),(0, 0), 
                im.Scale(im.Crop(im.Scale(image,width, height),(0,crop/4, width, height-3*crop/4)), 0.5*width*height/(height-crop),height),(640+parallax,0), 
                im.Scale(im.Crop(im.Scale(image,width, height),(0,crop/4, width, height-3*crop/4)), 0.5*width*height/(height-cop),height))
    
    bg3d: Takes an (background) image and a positive value (parallax) as parameters. The greater the value of "parallax" is, the farther away from the viewer (farther behind the screen) your image will appear.

    sprite3d: Takes an image, its width and height and two additional parameters: "parallax" is again used to position an image closer to the viewer (popping out of the screen (negative value)) or farther away form the viewer (appearing behind the screen (positive value)).
    Additionally a positive value can be assigned to the "crop"-parameter which will cut off some pixels from the top and bottom of the sprite (1/4 top, 3/4 bottom) while simultaneously zooming in on the sprite (its height is preserved, its width is enlarged proportionally).

Some screenshots:

Actual gameplay:

Image

Image

Image

Anaglyph converted (red/cyan, not actual screenshots, just for easier 3D viewing):

Image

Image

Image

A quick video:


Enjoy and feel free to comment/criticize/use in your own creations.

Re: 3D Stereoscopic Sample (Side-By-Side for your fancy HDTV

Posted: Wed May 07, 2014 10:36 am
by CrimsonMoon
I'm not using 3D but this is neat, thank you for sharing! :D

Re: 3D Stereoscopic Sample (Side-By-Side for your fancy HDTV

Posted: Mon Oct 26, 2015 4:36 am
by Abraham
Future is near!!!

Re: 3D Stereoscopic Sample (Side-By-Side for your fancy HDTV

Posted: Mon Dec 28, 2015 5:23 am
by ChronoWorkS
The first effect needs some kind of glasses? I mean, like the red-cian to see the 3D better

Re: 3D Stereoscopic Sample (Side-By-Side for your fancy HDTV

Posted: Sun Jul 10, 2016 12:01 am
by Shagwrath
b.hellmark wrote: Anaglyph converted (red/cyan, not actual screenshots, just for easier 3D viewing):
Is there anyway this could be adapted to output red/cyan anaglyph instead of the side by side stereoscopic?

I'm working on a KN with an 80's theme and I might use this for a fun little feature if it's possible.

Re: 3D Stereoscopic Sample (Side-By-Side for your fancy HDTV)

Posted: Tue May 24, 2022 3:16 pm
by Andredron
Due to my scarcity of mind, I don’t even know where this can be applied, but you have done a great job.

I saved your video back in 2016

https://m.vk.com/video189145553_4562390 ... 45553_1950

πŸ‘πŸ‘πŸ‘