import viz import random #Enable full screen anti-aliasing (FSAA) to smooth edges viz.setMultiSample(4) viz.go() #Increase the Field of View viz.MainWindow.fov(60) viz.move([0, 0, -8]) piazza = viz.addChild('piazza.osgb') for x in [-3, -1, 1, 3]: for z in [4, 2, 0, -2, -4]: plant = viz.addChild('plant.osgb', cache=viz.CACHE_CLONE) plant.setPosition([x, 0, z]) plant.setEuler([random.randint(0, 360), 0, 0]) temp = random.random() plant.setScale([temp, temp, temp])
def myTimer( self, num ): #Add a model by the given name and place it according to the counter. #Advance the counter. self.counter += .1 data = ' ' + str(self.counter) time_data.truncate() time_data.write(data) starting_time= viz.tick() def getdata(): #orientation = viz.MainView.getEuler() #position = viz.MainView.getPosition() #data = str(subject) + '\t' + str(orientation) + '\t' + str(position) + '\n' elapsed_time= starting_time-viz.tick() vizact.ontimer(1,getdata) #Call the class. modelMaker('box.wrl') viz.move(0,1.5,2)
import viz import vizinput viz.setMultiSample(4) viz.fov(60) viz.go() #Prompt for the participant's identification number. subject = vizinput.input('What is the participant number?') viz.move([0,0,2]) #Add the environment piazza = viz.addChild('piazza.osgb') #Add the pigeon. pigeon = viz.addAvatar('pigeon.cfg',pos=[-0.9, 2.88, 11.3],euler=[100,0,0]) pigeon.state(1) #ask the question we will record data for critical_question = viz.addText('Do you see a pigeon?',viz.SCREEN) yes = viz.addText('Yes!',viz.SCREEN) no = viz.addText('No!',viz.SCREEN) critical_question.alignment(viz.ALIGN_CENTER_TOP) critical_question.setPosition(.5,.9) yes.alignment(viz.ALIGN_LEFT_TOP) yes.setPosition(.25,.75)
import viz import random #Enable full screen anti-aliasing (FSAA) to smooth edges viz.setMultiSample(4) viz.go() #Increase the Field of View viz.MainWindow.fov(60) viz.move([0,0,-8]) piazza = viz.addChild('piazza.osgb') for x in [-3, -1, 1, 3]: for z in [4, 2, 0, -2, -4]: plant = viz.addChild('plant.osgb',cache=viz.CACHE_CLONE) plant.setPosition([x,0,z]) plant.setEuler([random.randint(0,360),0,0]) temp = random.random() plant.setScale([temp,temp,temp])
def move(a,b,c): viz.move(a,b,c)
# CAVE project import viz import vizshape import vizinput import vizinfo import vizproximity env = viz.addEnvironmentMap('sky.jpg') viz.clearcolor(viz.SKYBLUE) viz.mouse.setScale(100, 2) # 100x movement speed, 2x rotation speed viz.move([10, 10, 10]) # i think this sets the starting position to 10,10,10 karnak = viz.addChild('KarnakFBX.fbx') viz.setMultiSample(4) viz.go() vizshape.addAxes() info = vizinfo.InfoPanel("Let get started") sensorAvatar1 = vizproximity.Sensor(vizproximity.Box( [3170, 160, 3051], center=[3123.10181, 160.43307, -7414.27441]), source=karnak) sensorAvatar2 = vizproximity.Sensor(vizproximity.Box( [749, 741, 1439], center=[11489.54081, 447.63779, -2581.69801]), source=karnak) sensorAvatar3 = vizproximity.Sensor(vizproximity.Box( [1400, 422, 1400], center=[3854.15869, 375.59055, -1661.75696]), source=karnak) sensorAvatar4 = vizproximity.Sensor(vizproximity.Box( [8555, 811, 6949], center=[6046.80322, 334.64569, 189.79089]),
import viz import vizact import vizshape viz.go() VRPN_SOURCE = '[email protected]' #VRPN_SOURCE = 'Nexus@localhost' viz.move([0,-1,-5]) axes = vizshape.addAxes(length=0.5) vrpn = viz.add('vrpn7.dle') headtracker = vrpn.addTracker(VRPN_SOURCE) headtracker.swapPos([-1,3,-2]) #viz.link(headtracker,axes) def showData(): print('position') print headtracker.getPosition() # print headtracker.getEuler() vizact.ontimer(1,showData)
import viz import vizact import vizfx import viztask ### Vizard ### User import World import BahnhofContent ### User ### Initialisierung myWorld = World.World() viz.move(-80, 2.5, -41) #Fraport viz.collision(True) ### Initialisierung ### Scene static hbf = vizfx.addChild('FFM-HBhf.osgb') #hbf.setPosition(80, -2.5, 41) hbf.anisotropy(8) uhren = BahnhofContent.GleisUhren() uhren.loadModel(hbf) uhren.setTime(12, 20) ### Scene static ### Scene dynamic
import viz import vizact import vizshape viz.go() VRPN_SOURCE = '[email protected]' #VRPN_SOURCE = 'Nexus@localhost' viz.move([0, -1, -5]) axes = vizshape.addAxes(length=0.5) vrpn = viz.add('vrpn7.dle') headtracker = vrpn.addTracker(VRPN_SOURCE) headtracker.swapPos([-1, 3, -2]) #viz.link(headtracker,axes) def showData(): print('position') print headtracker.getPosition() # print headtracker.getEuler() vizact.ontimer(1, showData)
import viz #Enable full screen anti-aliasing (FSAA) to smooth edges viz.setMultiSample(4) viz.go() #Increase the Field of View viz.MainWindow.fov(60) viz.move([7,0,-8]) piazza = viz.addChild('piazza.osgb') for x in [-3, -1, 1, 3]: for z in [4, 2, 0, -2, -4]: plant = viz.addChild('plant.osgb',cache=viz.CACHE_CLONE) plant.setPosition([x,0,z]) plant.setEuler([0,0,20]) plant.setScale([0.5,0.5,0.5])
def reset_main_viewer(): viz.move(0,0,0)