本文整理汇总了Python中viz.addChild函数的典型用法代码示例。如果您正苦于以下问题:Python addChild函数的具体用法?Python addChild怎么用?Python addChild使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addChild函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: addAppendage
def addAppendage(avatar, skinChoices, skin = 0, appendage = 0):
global thirdAppendage, usingInvisibleRod
thirdAppendageHorn = viz.addGroup()
if(appendage == 0):
#Third Arm
usingInvisibleRod = False
thirdAppendage = viz.addChild(resources.ARM)
if skin == 9:
texture = viz.addTexture("skin_tones/010.png")
texture.wrap(viz.WRAP_S,viz.REPEAT)
texture.wrap(viz.WRAP_T,viz.REPEAT)
else:
texture = viz.addTexture("skin_tones/00" + skinChoices[skin] + ".png")
texture.wrap(viz.WRAP_S,viz.REPEAT)
texture.wrap(viz.WRAP_T,viz.REPEAT)
thirdAppendage.texture(texture)
thirdAppendage.emissive([.75, .75, .75])
thirdAppendage.setScale(resources.ARM_SCALE)
elif(appendage == 1):
#Cylinder
usingInvisibleRod = False
thirdAppendage = viz.addChild(resources.CYLINDER)
thirdAppendage.setScale(resources.ARM_SCALE)
thirdAppendage.setParent(thirdAppendageHorn)
global tahLink
tahLink = viz.link(avatar.getBone('Bip01 Spine'), thirdAppendageHorn)
global offsetOp
offsetOp = tahLink.preTrans([0, 0.3, 0.1])
tahLink.preEuler([-90.0, 0.0, 0.0])
thirdAppendage.collideBox()
thirdAppendage.disable(viz.DYNAMICS)
TouchCube.thirdAppendage = thirdAppendage
开发者ID:vhilab,项目名称:thirdArm,代码行数:35,代码来源:appendagemanager.py
示例2: main
def main():
global wingl
global wingr
viz.cam.setHandler(vizcam.KeyboardCamera())
myo.init()
gyrolist = [[0,0,0]]
viz.setMultiSample(4)
viz.fov(150)
wingl = viz.addChild('basketball.osgb')
wingl.setScale([10,0.3,1])
wingl.setCenter([100,100,100])
wingl.setEuler([0,90,0])
wingl.collideSphere(0.5)
lStartPOS = [ 0, 2.5, 2 ]
wingl.setPosition( lStartPOS )
wingr = viz.addChild('basketball.osgb')
wingr.setScale([10,0.3,1])
wingr.setCenter([100,100,100])
wingr.setEuler([0,90,0])
wingr.collideSphere(0.5)
rStartPOS = [ 0, 2.5, 2 ]
wingr.setPosition( rStartPOS )
#viz.MainView.setPosition([0,2,-15])
hub = myo.Hub()
hub.set_locking_policy(myo.locking_policy.none)
hub.run(1000, Listener())
vizact.ontimer(0.01 ,updateMyo, [gy, gy2, gy3, wingl, orx, ory, orz, orw, or1x, or1y, or1z, or1w, wingr])
开发者ID:rhodesvr,项目名称:myo-march,代码行数:29,代码来源:myoTVDemo.py
示例3: main
def main():
### Configuration parameters
# moved to config.py
### Game startup
# overwrite escape key
viz.setOption("viz.default_key.quit", "0")
# Physics
viz.phys.enable()
# viz.phys.setGravity(0,0,0)
# Initialize pointer tool
# Unused?
glove = viz.addChild(".\\dataset\\Hand\\handPoint_Reduced.ply")
glove.disable([viz.PHYSICS, viz.DYNAMICS])
glovePhys = glove.collideSphere()
glove.setPosition([0, 1, 0])
glove.setScale([1, 1, 1])
# Initialize environment this will load the coliseum and sky
sky = viz.addChild("sky_day.osgb")
sky.collideMesh()
sky.disable(viz.DYNAMICS)
init.loadTemple()
# Initialize pointer controls
device = init.pointerInput(config.pointerMode, glove, sky)
# Initialize display
puzzle.model.display = init.DisplayInstance(config.dispMode, config.camMode, device, glove)
# init.display(config.dispMode)
# Initialize camera controls
# init.cameraInput(config.camMode,config.dispMode, device, glove)
# Launch menu system
menu.init()
puzzle.model.pointer = glove
puzzle.model.pointer.setScale(0.015, 0.015, 0.015)
puzzle.model.pointer.setEuler(0, -115, 0)
# Override default escape key map to call main menu
vizact.onkeydown(viz.KEY_ESCAPE, menu.toggle)
# # Record moviefilms
# viz.setOption('viz.AVIRecorder.maxWidth', '1280')
# viz.setOption('viz.AVIRecorder.maxHeight', '720')
# vizact.onkeydown(viz.KEY_F11, viz.window.startRecording, 'D:\\recording.avi')
# vizact.onkeydown(viz.KEY_F12, viz.window.stopRecording)
# Stuff to run on program termination
vizact.onexit(puzzle.controller.end)
开发者ID:erikmessier,项目名称:anatomy-puzzle,代码行数:54,代码来源:main.py
示例4: loadColiseum
def loadColiseum():
"""loads colosseum enviornment"""
sf = .5
colosseum = viz.addChild('.\\dataset\\environment\\coliseum.OSGB')
colosseum.setEuler([0,-90,0])
colosseum.setScale([sf,sf,sf])
colosseum.setPosition([-37.5*sf , 0, 0]) #center colisseum
pedistal = viz.addChild('.\\dataset\\environment\\capital.OSGB')
pedistal.setScale([100,100,100])
pedistal.setPosition([0,-7.26,0]) #Found by testing
开发者ID:erikmessier,项目名称:anatomy-puzzle,代码行数:11,代码来源:init.py
示例5: createEnvironment
def createEnvironment():
#create 2D environment
if parameters.DreiDEnvironment:
viz.clearcolor(viz.WHITE)
#look from above
viz.MainView.setPosition([0,50,0])
viz.MainView.setEuler([0,90,0])
goal.setEuler(0,90,0)
goal.color(viz.GREEN)
point.setEuler(0,90,0)
point.setPosition(0,20,0)
point.color(viz.RED)
arrow.setPosition(0,20,0)
arrow.color(viz.BLUE)
#or create 3d environment
else:
piazza = viz.addChild('piazza.osgb')
#look from above
viz.MainView.setPosition([0,1.8,0])
#viz.MainView.setEuler([0,90,0])
goal.setEuler(0,90,0)
goal.color(viz.GREEN)
point.setEuler(0,90,0)
point.setPosition(0,20,0)
point.color(viz.RED)
arrow.setPosition(0,20,0)
arrow.color(viz.BLUE)
开发者ID:HerrPeterPaul,项目名称:Masterarbeit,代码行数:35,代码来源:environment2D.py
示例6: loadTemple
def loadTemple(bounding = True):
"""loads temple enviornment"""
sf = 100
temple = viz.addChild('.\\dataset\\environment\\temple.OSGB')
temple.setEuler([0,90,0])
temple.setScale([sf,sf,sf])
temple.setPosition([0.0, -1.569, 0.0]) #Found by measuring
pedistal = viz.addChild('.\\dataset\\environment\\Column.OSGB')
pedistal.setScale([3.0, 3.0, 3.0])
pedistal.setPosition([0.0, -1.5, 0.0]) #Found by testing
if bounding == True:
dimensions = [2,4,1]
boundingBox = games.puzzleView.WireFrameCube(dimensions)
# boundingBox.setPosition(0,dimensions[1],0)
boundingBox.alpha(0.25)
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:17,代码来源:init.py
示例7: setModel
def setModel (self, path):
global model
global modelIsLoaded
if not (modelIsLoaded):
model = viz.addChild(path)
model.disable(viz.CULL_FACE)
model.setPosition(0,0,60, viz.ABS_GLOBAL)
model.setEuler([0,0,0])
alphaSlider.set(1.0)
modelIsLoaded = True
开发者ID:kevinsp,项目名称:DvB,代码行数:10,代码来源:GUI.py
示例8: __init__
def __init__(self):
if Falcon._captainFalcon == None:
Falcon._captainFalcon = viz.addChild(Falcon._MODEL_FILE)
Falcon._captainFalcon.visible(viz.OFF)
self.node = Falcon._captainFalcon.copy()
viz.VizNode.__init__(self,self.node.id)
self.collideBox()
self.initEuler()
self.initForces()
开发者ID:vhilab,项目名称:thirdArm,代码行数:11,代码来源:BalloonsClassesOld.py
示例9: setUpWorld
def setUpWorld():
global city
city = viz.addChild('metro.osgb')
# NOTE: Look at CityModel.py for more details on the avatars, cars, and pigeons.
viz.addChild('models/People/CC2_f001_hipoly_A1_v2.cfg')
# Add avatars
for avatarInfo in cityModel.PEOPLE_INFO:
addAvatarToWorld(avatarInfo)
# Add cars
for carInfo in cityModel.CARS_INFO:
addCarToWorld(carInfo)
# Add pigeons
for pigeonInfo in cityModel.PIGEONS_INFO:
addPigeonToWorld(pigeonInfo)
# Fog color
viz.fogcolor([.5] * 3)
开发者ID:vhilab,项目名称:Demos,代码行数:21,代码来源:Flying_Demo_2015.py
示例10: setup
def setup(self):
yield viztask.waitTime(3)
self.head.reset()
stamp = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
self.output = os.path.join(
DESKTOP, 'tracing-data', '{}-{:08x}'.format(
stamp, random.randint(0, 0xffffff)))
logging.info('storing output in %s', self.output)
self.environment = viz.addChild('dojo.osgb')
开发者ID:EmbodiedCognition,项目名称:tracing-experiment,代码行数:12,代码来源:main.py
示例11: CreateRoom
def CreateRoom():
#Load in the entire room, s tore all geometry in the roomgroup
#BL:start
global roomGroup
# roomGroup = viz.addChild("Resources/NewRoom/vroom.obj")
roomGroup = viz.addChild('Resources/NewRoom/labroom.osgb')
roomGroup.setScale([0.8,0.75,0.8])
# roomGroup.setPosition([-0.4,0,-1.4])
# roomGroup.setPosition(-3, -1.75, 0, viz.ABS_GLOBAL)
roomGroup.emissive([1, 1, 1])
#BL:end
# Lag...
placeMirror()
开发者ID:vhilab,项目名称:thirdArm,代码行数:13,代码来源:mirrorroom.py
示例12: addArm
def addArm(texturePath, pathToArm):
# armPointer = viz.addChild(resources.ARM)
armPointer = viz.addChild(pathToArm)
texture = viz.addTexture(texturePath)
texture.wrap(viz.WRAP_S,viz.REPEAT)
texture.wrap(viz.WRAP_T,viz.REPEAT)
armPointer.texture(texture)
armPointer.emissive([.75, .75, .75])
armPointer.setScale(resources.ARM_SCALE)
armPointer.collideBox()
armPointer.disable(viz.DYNAMICS)
armPointer.visible(False)
return armPointer
开发者ID:vhilab,项目名称:fiveArms,代码行数:13,代码来源:appendagemanager.py
示例13: __init__
def __init__(self,use_keyboard = True, desktop_mode = False):
"""Initialization function."""
#
viz.phys.enable()
self.view = viz.MainView;
caveapp.CaveApplication.__init__(self,desktop_mode) #call constructor of super class, you have to do this explicitly in Python
self.wand = vizshape.addAxes()#load axis model to represent the wand\
self.cylinder = vizshape.addCylinder(15,0.002,axis=vizshape.AXIS_X)
self.cylinder.setEuler([0,0,0])
#self.cylinder.setCenter([0,0,-1])
self.cylinder.setPosition(7.5,0.08,0)
self.stuff = vizshape.addSphere(0.0001)
self.cylinder.setParent(self.stuff)
# temp = vizshape.addSphere(0.05)
# temp.setParent(self.cylinder)
# temp.setPosition(self.cylinder.getCenter())
self.wand = self.stuff
# self.wand.setPosition(.5,-1,0)
# self.cm = self.wand.getMatrix()
# self.Room = viz.addChild('D:\Cave software\NFI Cave\Scene\ScannedRoom.3DS')
# self.Room.collidePlane()
# self.Room.setScale([1.25,1.25,1.25])
# self.Room.setEuler([90,0,0])
# self.Room.setPosition([-1.5,0,1.55])
self.Room = viz.addChild('scene/ScannedRoom.3DS')
self.Room.collidePlane()
self.Room.setScale([0.002,0.002,0.002])
self.Room.setEuler([90,0,0])
self.Room.setPosition([-1.5,0.015,1.58])
"""
mylight = viz.addLight()
mylight.enable()
mylight.position(0, 1, 0)
mylight.spread(180)
mylight.intensity(2)
# vizact.onkeydown('f', dance)
"""
viz.disable(viz.LIGHTING)
self.headLight = viz.MainView.getHeadLight() #disable the headlight
self.headLight.disable() #the headlight is disabled because the piazza.osgb is already shaded
self.use_keyboard = use_keyboard #store if we want to use the keyboard
self.time = 0.0 #note that to 0.0 is important because it is a double precision floating point number
开发者ID:Dethro16,项目名称:NFI,代码行数:51,代码来源:Main.py
示例14: __init__
def __init__(self, use_keyboard = True, desktop_mode = True):
caveapp.CaveApplication.__init__(self, desktop_mode) #call constructor of super class, you have to do this explicitly in Python
self.wand = vizshape.addAxes()#load axis model to represent the wand
self.thing = viz.addChild('plant.osgb') #load plant model to represent the thing
self.horse = viz.addChild('horse.wrl') #load a horse model (this model will be animated in cave space)
self.horse.color(0.5,0.5,0.5)#make the horse gray
self.horse.disable(viz.LIGHTING) #disable the shading of the horse
self.worldModel = viz.add('piazza.osgb') #load a world model
self.headLight = viz.MainView.getHeadLight() #disable the headlight
self.headLight.disable() #the headlight is disabled because the piazza.osgb is already shaded
self.use_keyboard = use_keyboard #store if we want to use the keyboard
self.time = 0.0 #note that to 0.0 is important because it is a double precision floating point number
self.forwardVelocity = 0.0
开发者ID:Dethro16,项目名称:NFI,代码行数:23,代码来源:Main_Balance_Board.py
示例15: main
def main():
viz.vsync(viz.ON)
viz.window.setFullscreenMonitor([2])
viz.setMultiSample(4)
viz.MainWindow.clip(0.01, 200)
viz.go(viz.FULLSCREEN)
environment = viz.addChild("piazza.osgb")
environment.setPosition(2.75, 0, -0.75)
mocap = phasespace.Phasespace()
head = mocap.get_rigidTracker("hmd")
# DOES NOT ACCOUNT FOR RIGID BODY OFFSET DURING RESET
# mocap.track_rigid('Resources/hmd-nvisMount.rb', center_markers=(1,2))
head.link_pose(viz.MainView)
# glove = mocap.track_points([8, 9, 10])
paddle = mocap.track_rigid({17: (0, 0, 1), 19: (0, 0, 0), 20: (1, 0, 0), 22: (0, 1, 0)})
mocap.start_thread()
# mocap.start_timer()
def log_mocap(timer_id):
# print 'glove#9 pos {0[1]:.2f} {0[1]:.2f} {0[2]:.2f}'.format(*glove.get_marker(9))
print "head pos {0[0]:.2f} {0[1]:.2f} {0[2]:.2f}, quat {1[0]:.3f} {1[1]:.3f} {1[2]:.3f} {1[3]:.3f}".format(
*head.get_pose()
)
print "main " + str(viz.MainView.getPosition())
# print 'paddle pos {0[0]:.2f} {0[1]:.2f} {0[2]:.2f}, quat {1[0]:.3f} {1[1]:.3f} {1[2]:.3f} {1[3]:.3f}'.format(*paddle.get_pose())
viz.callback(viz.TIMER_EVENT, log_mocap)
viz.starttimer(0, 1, viz.FOREVER)
def keydown(key):
if key == "h":
head.reset()
if key == "H":
head.save()
elif key == "1":
print "Marker Pos: " + str(mocap.get_MarkerPos(1))
viz.callback(viz.KEYDOWN_EVENT, keydown)
开发者ID:YanjieGao,项目名称:ExperimentBase,代码行数:50,代码来源:phasespace_newTest.py
示例16: __setupWorld__
def __setupWorld__(self):
#Initialize cave and load the powerwall#
self.cave = vizcave.Cave()
#This line of code opens the file if a filename is provided and loads the corner co-ordinates from it, else uses the default co-ordinates#
self.cave.load(self.caveWallFileName) if None is not self.caveWallFileName else self.cave.addWall(self.powerwall)
# TODO: Pair every obstacle with an invisible "hat" object to detect when the obstacle was avoided.
# Create a seperate module that does this automatically for each object added.
# Like from a config file.
self.crate = viz.addChild( 'crate.osgb' )
self.crate.setScale([.2,.2,.2])
self.crate.setPosition([-.45, 0, -.10])
self.cratePole = vizshape.addCylinder(height = .5, radius = 0.025)
self.cratePole.setPosition( [-.45, .3, -.10] )
self.cratePole.alpha(0.5)
self.avatar = viz.addAvatar('duck.cfg')
self.avatar.setScale(.2, .2, .2)
self.avatar.setPosition([-1, .1, -.10])
#self.floor = viz.addChild('lab.osgb')
self.floor = viz.addChild('piazza.osgb')
开发者ID:performlabrit,项目名称:VRWalking-Preliminary,代码行数:24,代码来源:WEnvironment.py
示例17: bambooForest
def bambooForest(self):
# Add the ground plane
ground = viz.addChild('ground.osgb')
# Bamboo sticks
bambooForest1 = []
bambooForest2 = []
# add 200 bamboo trees to each forest
for i in range(0, 400, 1):
bambooForest1.append(vizshape.addCylinder(random.randint(10,16),0.1))
bambooForest2.append(vizshape.addCylinder(random.randint(10,16),0.1))
bambooForest1[i].setPosition(random.randint(-16,-3),0.5,random.randint(-20,20))
bambooForest2[i].setPosition(random.randint(3,16),0.5,random.randint(-20,20))
bambooForest1[i].color(0.3,0.8,0.3)
bambooForest2[i].color(0.3,0.8,0.3)
开发者ID:jorgeleong,项目名称:Python-VR,代码行数:15,代码来源:Fajen_Experiment.py
示例18: main
def main():
viz.setOption('viz.fullscreen.monitor', 1)
viz.setOption('viz.window.width', 2 * 640)
viz.setOption('viz.window.height', 480)
viz.setMultiSample(4)
viz.MainWindow.clip(0.01, 500)
vizconfig.register(nvis.nvisorSX111())
viz.go(viz.FULLSCREEN)
piazza = viz.addChild('piazza.osgb')
mocap = phasespace.Mocap('192.168.1.230')
head = mocap.track_rigid('Resources/hmd-nvis.rb', center_markers=(0, 5))
head.link_pose(viz.MainView)
glove = mocap.track_points([8, 9, 10])
paddle = mocap.track_rigid({
17:(0, 0, 1),
19:(0, 0, 0),
20:(1, 0, 0),
22:(0, 1, 0),
})
mocap.start_thread()
#mocap.start_timer()
def log_mocap(timer_id):
print 'glove#9 pos {0[1]:.2f} {0[1]:.2f} {0[2]:.2f}'.format(*glove.get_marker(9))
print 'head pos {0[0]:.2f} {0[1]:.2f} {0[2]:.2f}, quat {1[0]:.3f} {1[1]:.3f} {1[2]:.3f} {1[3]:.3f}'.format(*head.get_pose())
print 'paddle pos {0[0]:.2f} {0[1]:.2f} {0[2]:.2f}, quat {1[0]:.3f} {1[1]:.3f} {1[2]:.3f} {1[3]:.3f}'.format(*paddle.get_pose())
viz.callback(viz.TIMER_EVENT, log_mocap)
viz.starttimer(0, 1, viz.FOREVER)
def keydown(*args):
head.reset()
paddle.reset()
viz.callback(viz.KEYDOWN_EVENT, keydown)
开发者ID:EmbodiedCognition,项目名称:tracing-experiment,代码行数:43,代码来源:phasespace_test.py
示例19: loadTemple
def loadTemple(bounding = True):
"""loads temple enviornment"""
global boundingBox
global temple
sf = 100
temple = viz.addChild('.\\dataset\\environment\\temple.OSGB')
temple.setEuler([0,90,0])
temple.setScale([sf,sf,sf])
temple.setPosition([0,-2.8, 0]) #Found by testing
# pedistal = viz.addChild('.\\dataset\\environment\\Column.OSGB')
# pedistal.setScale([3.0,3.0,3.0])
# pedistal.setPosition([0,-1.5,0]) #Found by testing
if bounding == True:
dimensions = [1,2,0.5]
boundingBox = puzzle.view.wireframeCube(dimensions)
boundingBox.setPosition(0,dimensions[1]/2,0)
boundingBox.alpha(0.25)
开发者ID:erikmessier,项目名称:anatomy-puzzle,代码行数:20,代码来源:init.py
示例20: create3DEnvironment
def create3DEnvironment():
#ground = viz.add('tut_ground.wrl') # Add ground
#ground.collidePlane() # Make collideable plane
#viz.clearcolor(viz.WHITE)
piazza = viz.addChild('piazza.osgb')
#look from above
viz.MainView.setPosition([0,1.8,0])
#viz.MainView.setEuler([0,90,0])
goal.setEuler(0,90,0)
goal.color(viz.GREEN)
point.setEuler(0,90,0)
point.setPosition(0,20,0)
point.color(viz.RED)
arrow.setPosition(0,20,0)
arrow.color(viz.BLUE)
开发者ID:HerrPeterPaul,项目名称:Masterarbeit,代码行数:20,代码来源:environment3D.py
注:本文中的viz.addChild函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论