本文整理汇总了Python中vizshape.addSphere函数的典型用法代码示例。如果您正苦于以下问题:Python addSphere函数的具体用法?Python addSphere怎么用?Python addSphere使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addSphere函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, target_signal=None, motion='suit'):
super(Experiment, self).__init__()
self.left_finger = vizshape.addSphere(0.02, color=viz.RED)
self.right_finger = vizshape.addSphere(0.02, color=viz.GREEN)
self.target = vizshape.addSphere(0.05, color=viz.WHITE)
self.target_signal = target_signal
self.setup_world()
self.setup_mocap(motion)
self.setup_proximity()
示例2: setUpHandSensors
def setUpHandSensors():
global rhandtarget, lhandtarget
rhsphere = vizshape.addSphere(radius = 0.05)
rhsphere.setParent(globals_oa.rhModel)
rhsphere.setPosition([0,0,.55])
rhsphere.disable(viz.RENDERING)
lhsphere = vizshape.addSphere(radius = 0.05)
lhsphere.setParent(globals_oa.lhModel)
lhsphere.setPosition([0,0,.55])
lhsphere.disable(viz.RENDERING)
if globals_oa.rhModel is not None:rhandtarget = vizproximity.Target(rhsphere)#globals_oa.rhModel)
if globals_oa.lhModel is not None:lhandtarget = vizproximity.Target(lhsphere)#globals_oa.lhModel)
示例3: loadStuffAtStart
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()
示例4: init
def init(flagPile):
global lhandtar, rhandtar, placeFlagSound, pickupFlagSound
# viz.playSound(globals_oa.AUDIO_DIRECTORY + 'bell.wav', viz.SOUND_PRELOAD)
placeFlagSound = viz.addAudio(globals_oa.AUDIO_DIRECTORY + "flag_in_ground.mp3")
placeFlagSound.play()
placeFlagSound.stop()
pickupFlagSound = viz.addAudio(globals_oa.AUDIO_DIRECTORY + "flag_in_hand.mp3")
pickupFlagSound.play()
pickupFlagSound.stop()
# adding a manager for touching the snails
global snailTouchManager
snailTouchManager = vizproximity.Manager()
# snailTouchManager.setDebug(viz.ON)
vizact.onkeydown("k", snailTouchManager.setDebug, viz.TOGGLE)
# adding sensor for the flag pile
flagPileSensor = vizproximity.Sensor(vizproximity.Sphere(0.3, center=(-0.8, -1, -1.8)), source=flagPile)
flagPileManager = vizproximity.Manager()
flagPileManager.addSensor(flagPileSensor)
vizact.onkeydown(",", flagPileManager.setDebug, viz.TOGGLE)
flagPileManager.onEnter(flagPileSensor, EnterProximity)
global rhandtar, lhandtar
if globals_oa.rhModel is not None:
rhsphere = vizshape.addSphere(radius=0.06)
rhsphere.setParent(globals_oa.rhModel)
rhsphere.setPosition([0, 0, 0.55])
rhsphere.disable(viz.RENDERING)
rhandtar = vizproximity.Target(rhsphere) # globals_oa.rhModel)
snailTouchManager.addTarget(rhandtar)
flagPileManager.addTarget(rhandtar)
if globals_oa.lhModel is not None:
lhsphere = vizshape.addSphere(radius=0.06)
lhsphere.setParent(globals_oa.lhModel)
lhsphere.setPosition([0, 0, 0.55])
lhsphere.disable(viz.RENDERING)
lhandtar = vizproximity.Target(lhsphere) # globals_oa.lhModel)
snailTouchManager.addTarget(lhandtar)
flagPileManager.addTarget(lhandtar)
# adding the sensors around the snails
for snailAndFlagItem in globals_oa.snailAndFlagItemsInZone1:
snailSensor = vizproximity.addBoundingSphereSensor(snailAndFlagItem.snailItemFromZoneModel, scale=(3.0))
snailTouchManager.addSensor(snailSensor)
snailTouchManager.onEnter(None, ShowFlagAtSnail)
示例5: addSphericalImage
def addSphericalImage( enabled=False, scene=viz.MainScene ):
landscape = vizshape.addSphere(radius=3.5, flipFaces=True, scene=scene)
landscape.color(viz.GRAY)
landscape.emissive(viz.GRAY)
landscape.setPosition([0.45,1.38,-1.38])
landscape.alpha(1) if enabled else landscape.alpha(0)
tex = viz.addTexture('resources/images/parkinglot.jpg')
landscape.texture(tex)
示例6: drawEyes
def drawEyes(self,draw_eyes):
"""Draw the eyes of the user"""
self.__assertBoolean(draw_eyes)
if self.__left_eye != None:
self.__left_eye.remove()
self.__left_eye = None
if self.__right_eye != None:
self.__right_eye.remove()
self.__right_eye = None
if draw_eyes:
self.__left_eye = vizshape.addSphere(self.__EYE_RADIUS)
self.__left_eye.color(1,0,0)
self.__right_eye = vizshape.addSphere(self.__EYE_RADIUS)
self.__right_eye.color(0,1,0)
示例7: __init__
def __init__(self, index, x, y, z):
self.index = index
self.center = x, y, z
self.sphere = vizshape.addSphere(0.1)
self.sphere.setPosition(self.center)
self.sphere.color(viz.WHITE)
self.sensor = vizproximity.addBoundingSphereSensor(self.sphere, scale=1)
self.signal = viztask.Signal()
self.sound = viz.addAudio('{:02d}.wav'.format(index))
示例8: setScreen
def setScreen(self, radius=DEFAULT_RADIUS):
self.radius = radius
self.screen = vizshape.addSphere(radius=self.radius,
slices = 32, stacks = 32,
flipFaces=True, cullFace=True, lighting=True)
self.screen.setPosition([0,1.82,0]) # Eyeheight
self.screen.setEuler([180,0,0])
self.screen.emissive([1,1,1])
示例9: AddSphere
def AddSphere(name, position):
sphere = vizshape.addSphere(radius=0.2)
sphere.setPosition(position)
sensor = vizproximity.addBoundingSphereSensor(sphere,scale=5)
sensor.name = name
sphereSensors.append(sensor)
manager.addSensor(sensor)
manager.onEnter(sensor, EnterSphere, sphere)
manager.onExit(sensor, ExitSphere, sphere)
示例10: setControl
def setControl(selectedControlSchema, isLeftHanded = 0):
# global rightHandPitchJitters, leftHandPitchJitters, rightHandYawJitters, leftHandYawJitters
# rightHandPitchJitters = Queue(maxsize=some_global_variables.numberOfRenderFramesToAverageThreshold)
# leftHandPitchJitters = Queue(maxsize=some_global_variables.numberOfRenderFramesToAverageThreshold)
# rightHandYawJitters = Queue(maxsize=some_global_variables.numberOfRenderFramesToAverageThreshold)
# leftHandYawJitters = Queue(maxsize=some_global_variables.numberOfRenderFramesToAverageThreshold)
# while not rightHandPitchJitters.full():
# rightHandPitchJitters.put(0.0)
# leftHandPitchJitters.put(0.0)
# rightHandYawJitters.put(0.0)
# leftHandYawJitters.put(0.0)
vizact.onupdate(0, controlSchemaForAppendages)
global rightForearmSphere, rightWristSphere, rightFingerSphere, leftForearmSphere, leftWristSphere, leftFingerSphere
rightForearmSphere = vizshape.addSphere(radius=0.02)
rightForearmSphere.color(viz.RED)
rightWristSphere = vizshape.addSphere(radius=0.02)
rightWristSphere.color(viz.GREEN)
rightFingerSphere = vizshape.addSphere(radius=0.02)
rightFingerSphere.color(viz.BLUE)
leftForearmSphere = vizshape.addSphere(radius=0.02)
leftForearmSphere.color(viz.CYAN)
leftWristSphere = vizshape.addSphere(radius=0.02)
leftWristSphere.color(viz.MAGENTA)
leftFingerSphere = vizshape.addSphere(radius=0.02)
leftFingerSphere.color(viz.YELLOW)
if not some_global_variables.SHOW_SPHERES:
rightWristSphere.visible(False)
rightFingerSphere.visible(False)
leftWristSphere.visible(False)
leftFingerSphere.visible(False)
rightForearmSphere.visible(False)
leftForearmSphere.visible(False)
示例11: setup
def setup():
global lhPPT, rhPPT, headPPT, headLink;
global lhSphere, rhSphere
nvis.nvisorSX111();
#nvis.nvisorSX60();
viz.mouse.setVisible(False)
#viz.cursor(viz.OFF);
view = viz.MainView
isense = viz.add('intersense.dle')
headTracker = isense.addTracker(port=1)
vizact.onkeydown('r',headTracker.resetHeading)
vrpn = viz.add('vrpn7.dle');
PPT_HOSTNAME = '171.64.33.43';
headPPTorig = vrpn.addTracker('[email protected]' + PPT_HOSTNAME, 0);
#Merge two links together
headPPT = viz.mergeLinkable(headPPTorig,headTracker)
headLink = viz.link(headPPT, viz.MainView);
headLink.postTrans([EYE_VECTOR[0], EYE_VECTOR[1], EYE_VECTOR[2]]);
#now add the PPT hands tracker
rhPPT = vrpn.addTracker('[email protected]' + PPT_HOSTNAME, 1)
lhPPT = vrpn.addTracker('[email protected]' + PPT_HOSTNAME, 2)
grid = vizshape.addGrid();
grid.color([0.5] * 3);
viz.callback(viz.KEYDOWN_EVENT, onKeyDown);
if(DEBUG_MODE):
print "adding spheres";
rhSphere = vizshape.addSphere(radius = 0.1, color = viz.WHITE);
lhSphere = vizshape.addSphere(radius = 0.1, color = viz.WHITE);
rfSphere = vizshape.addSphere(radius = 0.1, color = viz.WHITE);
lfSphere = vizshape.addSphere(radius = 0.1, color = viz.WHITE);
return;
示例12: __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
示例13: setup
def setup(avatar):
global headSphere, lhSphere, rhSphere, lfSphere, rfSphere;
global rhPos, lhPos, rfPos, lfPos, bodyPos;
rhPos = avatar.getBone('Bip01 R Hand').getPosition(viz.ABS_GLOBAL);
lhPos = avatar.getBone('Bip01 L Hand').getPosition(viz.ABS_GLOBAL);
rfPos = avatar.getBone('Bip01 R Foot').getPosition(viz.ABS_GLOBAL);
lfPos = avatar.getBone('Bip01 L Foot').getPosition(viz.ABS_GLOBAL);
bodyPos = avatar.getBone('Bip01').getPosition(viz.ABS_GLOBAL);
viz.MainView.setPosition(2.2, 0.5, -1.7)
viz.MainView.setEuler(-110, 0, 0)
viz.MainWindow.fov(90)
grid = vizshape.addGrid();
grid.color([0.5] * 3);
global bodyBox;
bodyBox = vizshape.addBox();
bodyBox.setScale(0.45, 1.2, 0.35);
bodyBox.visible(viz.OFF);
viz.callback(viz.KEYDOWN_EVENT, onKeyDown);
#link = viz.link(avatar.getBone('Bip01 Head'), viz.MainView)
#link = viz.link(viz.MainView, avatar.getBone('Bip01 Head'))
#link.postTrans([0, 0, -0.2]);
if(DEBUG_MODE):
print "adding spheres";
rhSphere = vizshape.addSphere(radius = 0.1, color = viz.WHITE);
lhSphere = vizshape.addSphere(radius = 0.1, color = viz.WHITE);
rfSphere = vizshape.addSphere(radius = 0.1, color = viz.WHITE);
lfSphere = vizshape.addSphere(radius = 0.1, color = viz.WHITE);
headSphere = vizshape.addSphere(radius = 0.1, color = viz.YELLOW);
return;
示例14: placeEyeNodes
def placeEyeNodes(self):
'''
For convenience, this places nodes at the cyclopean eye, left eye, and right eye.
When linkjing things to the eyes, link them to the cyclopean, left, or right eye nodes
e.g. viz.link(config.cycEyeNode,vizshape.addSphere(radius=0.05))
'''
IOD = self.hmd.getIPD()
print("IOD")
print(IOD)
self.cycEyeNode = vizshape.addSphere(0.015, color = viz.GREEN)
self.cycEyeNode.setParent(self.headTracker)
self.cycEyeNode.disable(viz.RENDERING)
self.leftEyeNode = vizshape.addSphere(0.005, color = viz.BLUE)
self.leftEyeNode.disable(viz.RENDERING)
self.leftEyeNode.setParent(self.headTracker)
self.leftEyeNode.setPosition(-IOD/2, 0, 0.0,viz.ABS_PARENT)
self.rightEyeNode = vizshape.addSphere(0.005, color = viz.RED)
self.rightEyeNode.disable(viz.RENDERING)
self.rightEyeNode.setParent(self.headTracker)
self.rightEyeNode.setPosition(IOD/2, 0, 0.0,viz.ABS_PARENT)
示例15: addPoliceLights
def addPoliceLights(scene=viz.MainScene):
policeLight = vizfx.addSpotLight(scene=scene)
policeLight.setEuler(-105, 0, 0)
policeLight.color(viz.WHITE)
policeLight.emissive(viz.WHITE)
policeLight.spotexponent(1)
policeLight.quadraticattenuation(1)
policeLight.intensity(10)
orb = vizshape.addSphere(radius=0.4, flipFaces=True, scene=scene)
orb.color(viz.WHITE)
orb.emissive(viz.WHITE)
orb.alpha(1)
viz.link(policeLight, orb)
return policeLight