• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python vizshape.addSphere函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vizshape.addSphere函数的典型用法代码示例。如果您正苦于以下问题:Python addSphere函数的具体用法?Python addSphere怎么用?Python addSphere使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了addSphere函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()
开发者ID:EmbodiedCognition,项目名称:tracing-experiment,代码行数:11,代码来源:main.py


示例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)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:12,代码来源:MoleculeGrabbingHandTarget.py


示例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()
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:29,代码来源:TCR2_Main.py


示例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)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:46,代码来源:SnailHunt.py


示例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)
开发者ID:vhilab,项目名称:homelessness-study,代码行数:9,代码来源:CarScene.py


示例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)
开发者ID:WykonGoar,项目名称:CaveTargetSchooter,代码行数:18,代码来源:cavelib3.py


示例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))
开发者ID:EmbodiedCognition,项目名称:cube-experiment,代码行数:9,代码来源:targets.py


示例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])
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:10,代码来源:spherical_player_Vive.py


示例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)
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:12,代码来源:Challenge+6.py


示例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)
开发者ID:vhilab,项目名称:fiveArms,代码行数:33,代码来源:appendagemanager.py


示例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;
开发者ID:vhilab,项目名称:thirdArm,代码行数:40,代码来源:pptextension.py


示例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
开发者ID:Dethro16,项目名称:NFI,代码行数:51,代码来源:Main.py


示例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;
开发者ID:vhilab,项目名称:thirdArm,代码行数:38,代码来源:pptsimulation.py


示例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)
开发者ID:performlabrit,项目名称:IMSG-789,代码行数:24,代码来源:Oculus_inbuilt_Vizard.py


示例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
开发者ID:vhilab,项目名称:homelessness-study,代码行数:15,代码来源:PoliceNarrative.py


示例16: myCalibrationMethod

	def myCalibrationMethod(self):
		
		if ( self.calibrationInProgress == False):
			self.calibrationInProgress = True
			self.calibrationCounter = 0
			self.calibrationSphere = vizshape.addSphere(self.calibrationSphereRadius, color = viz.PURPLE)
			self.calibrationSphere.setParent(self.parentNode)
			self.setSphereRadius(self.parentNode.getPosition(viz.ABS_GLOBAL), self.calibrationPositions[self.calibrationCounter,:], 0)
			print 'FirstPos', self.calibrationPositions[self.calibrationCounter,:]
			newPos = [self.calibrationPositions[self.calibrationCounter,0], self.calibrationPositions[self.calibrationCounter,1], self.calibrationPositions[self.calibrationCounter,2]]
			self.calibrationSphere.setPosition(newPos[0], newPos[1], newPos[2],viz.ABS_PARENT)
			print 'Calibration Procedure Started'
		else:
			self.calibrationInProgress = False
			self.calibrationCounter = 0
			self.calibrationSphere.remove()
			print 'Quit Calibration!!'
开发者ID:performlabrit,项目名称:gazeToolsDemo,代码行数:17,代码来源:gazeTools.py


示例17: CreateVisualObjects

def CreateVisualObjects():

    global ball, Head, Hand, GazeLine, EyeBallLine;
    #creats a sphere(the ball) with radius of 5cm
    ball = vizshape.addSphere(radius = .05)
    #colors the ball red
    ball.color(viz.YELLOW)
    ball.visible(True)

    Origin = vizshape.addAxes()
    Origin.setPosition(0,0,0)
    #creats a sphere(the ball) with radius of 5cm
    #Head = vizshape.addCone( radius = 0.5, height = 0.8)
    Head = vizshape.addArrow(1, color = viz.YELLOW_ORANGE)
    #colors the ball red
    Head.color(viz.PURPLE)
    Head.visible(True)
    Head.setScale(.2,.2,.3)

    #creats a sphere(the hand) with radius of 10cm
    Hand = vizshape.addCylinder( height = 0.02, radius = 0.2)
    #colors the hand red
    Hand.color(viz.RED)
    Hand.visible(True)

    # Creating a Line to represent Gaze Vector
    viz.startLayer(viz.LINES)
    viz.vertex(0,0,0)
    viz.vertex(0,0,3)
    viz.vertexColor(viz.GREEN)
    GazeLine = viz.endLayer() # Object will contain both points and lines
    GazeLine.visible(True)
    GazeLine.setScale(5,5,5)


    # Creating a Line to represent Eye-Ball Vector
    viz.startLayer(viz.LINES)
    viz.vertex(0,0,0)
    viz.vertex(0,0,3)
    viz.vertexColor(viz.YELLOW)
    EyeBallLine = viz.endLayer() # Object will contain both points and lines
    EyeBallLine.visible(True)
    EyeBallLine.setScale(5,5,5)
开发者ID:KamranBinaee,项目名称:Visualization-Code,代码行数:43,代码来源:VisualizationCode.py


示例18: __init__

	def __init__(self,eyeTracker,eye,parentNode,renderToWindows = None,sphereColor=viz.RED):
		
		self.sizeInDegrees = 0.5
		self.sphereDistance = 1
		self.renderToWindows = renderToWindows
		from math import tan, radians
		
		self.radius = tan(radians(self.sizeInDegrees)) * self.sphereDistance
		#with viz.cluster.MaskedContext(viz.CLIENT1):
		self.node3D = vizshape.addSphere(radius=self.radius, color = sphereColor, alpha = 0.7)
		
		if( self.renderToWindows ):
			self.node3D.renderOnlyToWindows(self.renderToWindows)
		
		self.node3D.disable(viz.RENDERING)
		
		self.updateAct = []
		
		self.eyeTracker = eyeTracker
		self.eye = eye
		self.node3D.setParent(parentNode)
开发者ID:performlabrit,项目名称:gazeToolsDemo,代码行数:21,代码来源:gazeTools.py


示例19: setup

    def setup(self):
        # set up a folder to store data for a subject.
        dirname = self.find_output(threshold_min=GAP_MINUTES)
        self.output = os.path.join(BASE_PATH, dirname)
        logging.info('storing output in %s', self.output)

        # configure the phasespace.
        mocap = vrlab.Phasespace('192.168.1.230', freq=120)
        self.suit = mocap.track_points(range(len(suit.MARKER_LABELS)))
        self.leds = []
        for i in range(50):
            sphere = vizshape.addSphere(0.02, color=viz.RED)
            self.suit.link_marker(i, sphere)
            self.leds.append(sphere)
        mocap.start_thread()

        # set up a proximity manager to detect touch events.
        self.prox = vizproximity.Manager()
        #self.prox.setDebug(viz.ON)

        # add an environment and navigation to help with visualization.
        self.environment = viz.addChild('dojo.osgb')
        viz.cam.setHandler(None)
开发者ID:EmbodiedCognition,项目名称:cube-experiment,代码行数:23,代码来源:main.py


示例20: Create_Shape

def Create_Shape(Number,x_pace,y_pace,z_pace,set_Time) :
	#create an array of shapes
	shapes = []
#	ranges = ([-10,0],[1,11])
	X = list() #these will be saved to a file
	Y = list()
	Z = list()
	n = 0
	while (n<=Number):
		x = random.uniform(-4,4)
		y = random.uniform(-4,4)
		z = random.uniform(0,500)
		
		if (-3 <= x <= 3) and (-3 <= y <= 3):
			print('in exclusion range')
			print(n)
			pass
		else:
			shape = vizshape.addSphere(0.05,10,10)
			shape.setPosition([x,y,z])
			shape.color(1,1,1)
			shapes.append(shape)
			X.append(x)
			Y.append(y)
			Z.append(z)
			n += 1
			print(n)
	print('X:')
	print(X)
#	file = open('OpticFlow1.txt','w+')
#	csvw = csv.writer(file)
#	csvw.writerow(X)
#	csvw.writerow(Y)
#	csvw.writerow(Z)
#	file.close()
	
	viz.MainView.velocity(x_pace,y_pace,z_pace)
开发者ID:willpower2727,项目名称:VR_scripts,代码行数:37,代码来源:Vizard47.py



注:本文中的vizshape.addSphere函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python viztask.schedule函数代码示例发布时间:2022-05-26
下一篇:
Python report.Report类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap