• Home > Posts tagged 'stereo image'

Posts Tagged ‘stereo image’

Vue Stereo Image Camera Creation Script

Sunday, August 16th, 2009

This python script creates a pair of cameras for rendering stereo images in Vue. It’s pretty easy to do without the script but this just speeds things up a bit. Christina has two tutorials about making stereo camera’s on her web site. Its a basic solution that doesn’t generate an animated camera and it won’t work with cameras that aren’t flat and level. Originally created after a request from Jim Coe.

Note: This script does not render the scene. Once you have used it you will need to render the scene from each camera yourself and do whatever magic you need to do with the output.

Download: Vue Stereo Camera Script (3k Zip Archive)

Python Code


#******************************************************
# Creates a pair of cameras in a vue scene for
# rendering stereo position images
#
# - vuestereocamera.py
# - By Mark Caldwell
# - Version 0.1
# - 3rd September 2007
# - Copyright Mark Caldwell 2007
# - Tested with Vue 6.5 Infinite
#
# How to use in 3 easy steps
#
# 1. Download this file onto your computer
#
# 2. Position a camera where you want to render a
#    stereo image for and make sure it's your selected
#    camera
#
# 3. Then run script and wait for it to work
#    To run it go to Python -> Run Python Script
#    Then locate the file on your computer
#
#******************************************************

#------------------------------------------------------
# Get Input and Test Value is a positive floating point
#------------------------------------------------------

def TestValAngle (messagetxt,titletxt,default):
    hit=-2
    val=-1

    while hit<0:
        try:
            if float(val)>0:
                hit=1;
            elif hit==-2:
                val=Prompt (messagetxt,default,true,titletxt)
                hit=-1
            else:
                val=Prompt ("Error: Value must an positive number\n\n"+messagetxt,val,true,titletxt)
        except:
            hit=-1
            val=Prompt ("Error: Value must an positive number\n\n"+messagetxt,val,true,titletxt)

    return float(val)

#------------------------------------------------------
# Convert Degrees to Radians
#------------------------------------------------------

def degtorad(deg):
    rad=deg*(math.pi/180)
    return rad

#--------------------------------------------
# Start of Main Code
#--------------------------------------------

import math

separation=TestValAngle ('Eye Separation','Eye Separation','6.5')

camX=StoreCamera  ()

SwitchCamera (camX)

SelectByType(VuePython.VUEBasicObject.VOT_Camera)
cam = GetSelectedObjectByIndex(0)

pos=cam.Position()
rot=cam.GetRotationAngles()

y=(math.sin(degtorad(rot[2]))*separation)+pos[1]
x=(math.cos(degtorad(rot[2]))*separation)+pos[0]

cam.SetPosition(x,y,pos[2])

#----------------------------------------------
# End of Script
#----------------------------------------------    

Comments Off

Tags: , , , , , , ,
Posted in |

Vue Stereo Image Camera Creation Script Page

Saturday, August 15th, 2009

So glad I switched this site to WordPress – adding new pages is so much easier.

Tonight I’ve added a new page for the simple Vue Stereo Image Camera Creation Script I wrote back in 2007.

Vue Stereo Image Camera Creation Script

Monday, September 3rd, 2007

I was asked by Jim Coe if I knew of a script for creating a pair of cameras for rendering stereo images in Vue. I didn’t but writing one wasn’t particularly difficult. It isn’t a complete solution as it won’t generate an animated camera and it won’t work with cameras that aren’t flat and level. So here is a quick Vue python script to do just that…

Download: Vue Stereo Camera Script (3KB)

Edit: Of course you don’t need a script to create stereo images using Vue. Christina has two tutorials about this on her web site.