WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #16  
Old 02-21-2007, 10:27 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The vzf files you included contain about 20,000 polygons. This is most likely dropping your framerate and causing Vizard to be jumpy. You should consider using a lower resolution head.

Also, every time you hit the 'w' or 'b' key, you are loading a new face, instead of reusing an existing one. This will definitely kill your frame rate after a while. I posted a new version of your script that pre-loads the faces and only displays one at a time. It also fixes the problem with the heads overlaying each other.
Code:
import viz
viz.go(viz.FULLSCREEN)

#viz.collision(viz.ON)

#ALL TRACKER INITIALIZATION
#PORT_INTERSENSE = 3
#myTracker = viz.add('intersense.dls')
#PORT_PPT = 1
#ppt1 = viz.add('vizppt.dls')
#viz.tracker()
#myTracker.reset()  # Reset the tracker

music = viz.add('Soundtrack6.mp3')
#music.play()
music.loop(viz.ON)

target = viz.add('male.cfg')
target.translate(-2,0,0)
target.rotate(0,1,0, 90)
target.state(1)
#target.face('Stephen.vzf')
#target.face('biohead_talk.vzf')

whiteHead = viz.add('VRwhitemale.vzf')
blackHead = viz.add('VRblackmale.vzf')
whiteHead.visible(0)
blackHead.visible(0)

def ChangeMusic(next):
	global music
	music.stop()
	music = viz.add(next)
	music.play()

def StopTheMusic():
	global music
	music.stop()

def mykey(key): 
	if key == '1':
		ChangeMusic('Soundtrack1.mp3')
	elif key == '2':
		ChangeMusic('Soundtrack2.mp3')
	elif key == '3':
		ChangeMusic('Soundtrack3.mp3')
	elif key == '4':
		ChangeMusic('Soundtrack4.mp3')
	elif key == '5':
		ChangeMusic('Soundtrack5.mp3')
	elif key == '6':
		ChangeMusic('Soundtrack6.mp3')
	elif key == ' ':
		StopTheMusic()
	elif key == 'w':
		target.face(whiteHead)
		whiteHead.visible(1)
		blackHead.visible(0)
	elif key == 'b':
		target.face(blackHead)
		blackHead.visible(1)
		whiteHead.visible(0)

#viz.eyeheight(1.5)

viz.callback(viz.KEYBOARD_EVENT,mykey)
The solution to the jumpiness is to either upgrade your computer/graphics card or use a lower poly version of the head.
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


All times are GMT -7. The time now is 04:27 AM.


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