WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-12-2009, 12:04 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Dance party test

Here is an avatar stress test script. Sliders control the number of avatars and the update rate.

Code:
import viz
import vizact
viz.go()

MAX_AVATARS = 100
START_COUNT = 10

viz.MainView.setPosition([0, 1.5, -5])
viz.window.framerate(viz.NICE)

#dance beat
music = viz.add('carousel.wav',volume=0.15,loop=1)
music.play()

avatars = []
updateRate = 0
def addAvatar():
	a = viz.add('vcc_female.cfg')
	a.state(5)
	a.setPosition([.5*len(avatars), 0, 0])
	a.updaterate(updateRate)
	avatars.append(a)

for i in range(START_COUNT):
	addAvatar()
	
def removeAvatar():
	avatars.pop().remove()
	
	
import vizinfo
info = vizinfo.add('')
avatarSlider = info.add(viz.SLIDER, 'avatar count  '+str(START_COUNT))
updateRateSlider = info.add(viz.SLIDER, 'update rate 0   ')

def onAvatarSlider(pos):
	targetCount = int(pos * MAX_AVATARS)
	avatarSlider.label.message('avatar count: ' + str(targetCount))
	countDiff = targetCount - len(avatars)
	if countDiff > 0:
		#add avatars
		for i in range(countDiff):
			addAvatar()
	else:
		#subtract avatars
		for i in range(-countDiff):
			removeAvatar()
	
vizact.onslider(avatarSlider, onAvatarSlider)


def setUpdateRate(rate):
	global updateRate
	updateRate = rate * .2
	updateRateSlider.label.message('update rate' + str(round(updateRate, 3)))
	for a in avatars:
		a.updaterate(updateRate)
vizact.onslider(updateRateSlider, setUpdateRate)
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM
avatars dig Vizard 4 09-20-2007 03:29 PM
Avatars in an array and link/unlink betancourtb82 Vizard 7 09-05-2006 04:06 PM
maximum number of markers tavaksai Precision Position Tracker (PPT) 1 02-02-2006 09:09 PM
number of faces to load using the 'old' txt version of avatars bailenson Vizard 1 06-06-2004 12:30 PM


All times are GMT -7. The time now is 11:13 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC