예제 #1
0
def loadStuffAtStart():
 global city
#loading fadeSphere#
 globals_oa.fadingSphere = vizshape.addSphere(0.5, flipFaces=True)
 globals_oa.fadingSphere.alpha(0)
 globals_oa.fadingSphere.color(viz.BLACK)
 sphereLink = viz.link(viz.MainView, globals_oa.fadingSphere)
#loading the Crystal Ball Scene
 globals_oa.globeScene = vizfx.addChild(globals_oa.FILE_PATH_TO_GLOBE)
 globals_oa.globeScene.setScale([0.2,0.2,0.2])
 globals_oa.globeScene.setPosition([-1,0,0])
 globals_oa.globeScene.disable(viz.RENDERING)
 

 #load city scene assets
 city = vizfx.addChild(globals_oa.FILE_PATH_TO_CITY)
 city.setPosition([-8,0,11])
 city.disable(viz.RENDERING)
 if not globals_oa.transportSetUpCalled:
  transport_vhil.setUp()

 if not globals_oa.loadAudioAssetsCalled:
  audioCache.loadAudioAssets()

# if not globals_oa.initBoatCalled:
#  boat_scene.loadStuffAtStartAndHideThemALL()
  
 if not globals_oa.cg_scene_init_called:
  CG_scenes.loadStuffAtStartAndHideThemALL()
예제 #2
0
def loadStuffAtStartAndHideThemALL():
	global rampTexture
	globals_oa.initBoatCalled = True
	
	if not globals_oa.transportSetUpCalled: transport_vhil.setUp()

	if not globals_oa.loadAudioAssetsCalled: audioCache.loadAudioAssets()
	
	global bigCO2, bigH2O, footprints, bubble, lowPolyMole, highPolyMole
	globals_oa.boat = vizfx.addChild(globals_oa.boatWithMoleculesPath)
	globals_oa.boat.disable(viz.ANIMATIONS)
	globals_oa.boat.setPosition(0,-0.5,-6)
#	globals_oa.boat.hint(viz.PRELOAD_HINT)
	globals_oa.boat.setEuler([-90,0,0])
	oceanFloor = globals_oa.boat.getChild('OceanFloor.osgb')
	oceanFloor.setAnimationSpeed(0.25)
	H2O = globals_oa.boat.getChild('H2O_Molecule_Hovering')
	H2O.setPosition(.1,-0.13,0.05)
#	oceanFloor.visible(False)
	global h2co3molecule
	h2co3molecule = vizfx.addChild(globals_oa.pathToH2CO3molecule)
	h2co3moleculeScale = 7
	h2co3molecule.setScale(h2co3moleculeScale,h2co3moleculeScale,h2co3moleculeScale)
	h2co3molecule.visible(viz.OFF)
	
#	h2co3molecule.setPosition(globals_oa.h2CO3LocationUntilWeChangeAgain)
#	h2co3molecule.setAnimationSpeed(0.1)
#	h2co3molecule.setAnimationTime(8.9)
#	bigCO2 = vizfx.addChild(globals_oa.co2HoveringMoleculePath)
	#bigCO2 = globals_oa.boat.getChild('fallingMoleculeToTouch.OSGB')
	
	bigCO2 = vizfx.addChild(globals_oa.specialCO2)
	bigCO2.setPosition(0,21,20)
	bigCO2.setScale(7,7,7)
	lowPolyMole = bigCO2.getChild('singleCO2_noAnimation.OSGB')
	lowPolyMole.disable(viz.RENDERING)
	highPolyMole = bigCO2.getChild('singleCO2_highPoly.OSGB')
	bubble = bigCO2.getChild('bubble.OSGB')
	bigH2O = globals_oa.boat.getChild('H2Oanimated.OSGB')
	footprintfootprints = globals_oa.boat.getChild('footprints_withText.OSGB')
	#getting the falling molecules from the model and disabling their rendering
	for mole in LIST_OF_FALLING_MOLES:
		node = globals_oa.boat.getChild(mole)
		node.disable(viz.RENDERING)
		
	rampTexture = viz.addTexture(r'resources\whitesquare.jpg')
	
	#Turning off the rendering for preload, only to turn on their rendering in showStuff
	hideStuff()
def loadStuffAtStart():
	global city
	#loading the Crystal Ball Scene
	globals_oa.globeScene = vizfx.addChild(globals_oa.FILE_PATH_TO_GLOBE)
	globals_oa.globeScene.setScale([0.2,0.2,0.2])
	globals_oa.globeScene.setPosition([0,0,1])
	globals_oa.globeScene.disable(viz.RENDERING)

	#load city scene assets
	city = vizfx.addChild(globals_oa.FILE_PATH_TO_CITY)
	city.setPosition([-8,0,11])
	skyDome2 = viz.add('sky_day.osgb')
	city.disable(viz.RENDERING)
	skyDome2.disable(viz.RENDERING)
	
	if not globals_oa.transportSetUpCalled:
		transport_vhil.setUp()
예제 #4
0
def loadStuffAtStartAndHideThemALL():
	global rotatingSnail, corrodedRotatingSnail, fishZone1, fishZone2, egg
	globals_oa.cg_scene_init_called = True
	#loading the zones, if not loaded already
	if globals_oa.terrainZone1 is None:
		globals_oa.terrainZone1 = vizfx.addChild(globals_oa.FILE_PATH_TO_ZONE1)
		worldvizcode.initVFXforDC(globals_oa.terrainZone1) # should moved into loadAndHide?
#		worldvizcode.stopEffects()
		globals_oa.terrainZone1.setPosition(1,0,0.5)
		egg = globals_oa.terrainZone1.getChild('bubble.OSGB')
		egg.visible(viz.OFF)
		loadTheSnailFlagListAndHideFlags()

	if globals_oa.terrainZone3 is None:
		globals_oa.terrainZone3 = vizfx.addChild(globals_oa.FILE_PATH_TO_ZONE3)
		globals_oa.terrainZone3.setPosition(1,0,0.5)

	if not globals_oa.transportSetUpCalled:
		transport_vhil.setUp()

	if globals_oa.ocean is None:
		globals_oa.ocean = vizfx.addChild(globals_oa.FILE_PATH_TO_WATER)
		globals_oa.ocean.setPosition(0.0, 2.5, 0.0)
		globals_oa.ocean.setAnimationSpeed(0.25)
		globals_oa.ocean.draworder(9)

	if not globals_oa.loadAudioAssetsCalled:
		audioCache.loadAudioAssets()
	
#	fishZone1 = schooling.initialize(1)
#	fishZone2 = schooling.initialize(2)
#	schooling.hide(fishZone1)
#	schooling.hide(fishZone2)
	
	rotatingSnail = vizfx.addChild(globals_oa.ROTATING_SNAIL)
	rotatingSnail.setScale([0.1,0.1,0.1])
	rotatingSnail.visible(viz.OFF)
	
	corrodedRotatingSnail = vizfx.addChild(globals_oa.CORRODED_SNAIL)
	corrodedRotatingSnail.setScale([0.1, 0.1, 0.1])
	corrodedRotatingSnail.visible(viz.OFF)
	
	
	#Hiding pre-loaded assets
	hideStuff()
co2models = [co2molecule]
h2omodels = [h2omolecule]
for i in range(1,NUM_CO2):
 co2models.append(co2molecule.copy())
for i in range(1,NUM_H2O):
 h2omodels.append(h2omolecule.copy())

print "created co2models", co2models

'''#Main Setup Functions
headLight = viz.MainView.getHeadLight() 
headLight.disable() 
viz.clip(.01,1000)'''

#Setup tracking module
transport_vhil.setUp()

'''path = viz.res.getPublishedPath( 'vizconnect_config_vive_hand.py' )

viz.res.addPublishDirectory( os.path.join( viz.res.getVizardPath(), 'resources', 'fx') )
vizconnect.go( path )'''

def setUpMolecAnimation():
	global co2models, h2omodels
	for i in range(NUM_CO2):
		co2models[i].setPosition( .25 * i * (i * -1), 1.7, 0)
	for i in range(NUM_H2O):
		h2omodels[i].setPosition(2.5, .5, .4 * i * (i * -1))


def randomSortActions(moleculeSequence):