viz.go(viz.FULLSCREEN) # Setup keyboard/mouse tracker tracker = vizcam.addWalkNavigate(moveScale=2.0) tracker.setPosition([0,1.8,0]) viz.link(tracker,viz.MainView) viz.mouse.setVisible(False) # Load piazza environment piazza = viz.addChild('piazza.osgb') viz.addChild('piazza_animations.osgb') # Loop fountain sound #piazza.playsound('fountain.wav',viz.LOOP,node='fountain-sound') # Swap out sky with animated sky dome piazza.getChild('pz_skydome').remove() day = viz.add('sky_day.osgb') day.renderToBackground() kobe = viz.add('resources/CC2_m016_hipoly_A1_v2.cfg',pos=(0,0,5),euler=(180,0,0)) kobe.state(32) head = viz.addFace('avatars/kobe/kobe.vzf') kobe.setFace(head) talk = vizact.speak('kobe_speech.wav', threshold = 0, scale = 0.01, sync = True) sequence = vizact.sequence(talk, vizact.waittime(5), viz.FOREVER) kobe.addAction(sequence)
#add spherical video player sphere = spherical_player.Player(videoFile='Take8_OvalRunning.mp4', audioFile=None, PPT1=False, radius=250, loop=True) sphere.video.volume(0) sphere.setScreenPosition([0,10,5]) sphere.play() #add MLK, set up initial animation MLK = viz.addAvatar('Avatars/MLK/CC2_m005_hipoly_A2_v2.cfg') head = viz.addFace( 'MLK_head.vzf' ) MLK.setFace(head) vizact.onupdate(viz.PRIORITY_LINKS+1,head.setPosition,0,-.02,0.03,viz.REL_LOCAL) MLK.setPosition(0,.8,7.3) MLK.setEuler(180,0,0) MLK.state(11) speech = vizact.speak('MLKDream.wav', threshold = 0, scale = 0.006, sync = True) MLK.addAction(speech) #update view (pos) according to arrow keys MOVE_SPEED = 2.0 def UpdateView(): if (RIFT): yaw,pitch,roll = viewLink.getEuler() m = viz.Matrix.euler(yaw,0,0) dm = viz.getFrameElapsed() * MOVE_SPEED if viz.key.isDown(KEYS['forward']): m.preTrans([0,0,dm]) if viz.key.isDown(KEYS['back']): m.preTrans([0,0,-dm]) if viz.key.isDown(KEYS['left']): m.preTrans([-dm,0,0])
import viz import vizact viz.setMultiSample(4) viz.fov(60) viz.go() #demo of exchanging head and animating avatars female = viz.addAvatar('vcc_female.cfg') female.setPosition([-0.5,0.6,2.3]) female.setEuler([180,0,0]) female.state(6) #female.face('biohead_talk.vzf') female.face('HILLARY.vzf') male = viz.addAvatar('vcc_male.cfg') male.setPosition([0.5,0.6,2.3]) male.setEuler([180,0,0]) male.state(4) male.face('BILL.vzf') speech = vizact.speak('jfk.wav') #morphing_face = female.face('HILLARY.vzf') #morphing_face2 = male.face('BILL.vzf') vizact.onkeydown(' ', female.addAction, speech) vizact.onkeydown('c', male.addAction, speech)
plant7.setScale(3, 3, 3) plant7.setPosition(-52, 0, -30) #######################sound############################ #Adding sound sound = viz.addAudio('radio2.mp3') #sound.loop(viz.ON) sound.volume(2) sound.setTime(3) sound.setRate(1) sound.play() ######################################################## speech = vizact.speak('jfk.wav') run11 = vizact.walkTo([-45, 2.40, 30.5], verb='run') run21 = vizact.walkTo([-45, 2.40, 30.5], verb='run') run31 = vizact.walkTo([-45, 2.40, 30.5], verb='run') run41 = vizact.walkTo([-42, 2.40, 30.5], verb='run') run12 = vizact.walkTo([-48, 0, 29], verb='run') run22 = vizact.walkTo([-49, 0, 28], verb='run') run32 = vizact.walkTo([-49, 0, 27], verb='run') run42 = vizact.walkTo([-42, 0, 30], verb='run') run13 = vizact.walkTo([-45, 0, -59], verb='run') run23 = vizact.walkTo([-46, 0, -59], verb='run') run33 = vizact.walkTo([-47, 0, -59], verb='run') run43 = vizact.walkTo([-42, 0, -59], verb='run')
import viz import vizact viz.setMultiSample(4) viz.fov(60) viz.go() ground = viz.addChild('ground.osgb') viz.MainView.move([0,0,7]) #set up MainView facing Messi viz.MainView.setEuler([180,0,0]) viz.MainView.setPosition([0,1.6,1]) #get male body and custom messi head and then attach the two messi = viz.add('vcc_male.cfg') head = viz.addFace('messi.vzf') messi.setFace( head,'Bip01 Head','Bip01 Neck') #set idle state for speech action #vizact.speak has extra parameters to tone down the effect of the .wav file which previously caused #Messi's head to change size drastically with the sound levels of the .wav file messi.state(1) messi.addAction(vizact.speak('messi_speech2.wav', threshold=.5, scale=0.0055, sync=True))