PDA

View Full Version : <window>.isCulled help


BSUGeek
10-07-2014, 11:14 AM
Hi everyone,

I'm trying to figure out this <window>.isCulled stuff. I'm just testing it out right now. I have an avatar not in view when the world opens. He then begins to walk until he is in view. and I want the program to print out I see you but nothing is happening once the avatar walks into view. any help will be greatly appreciated.



avatar = viz.addAvatar('vcc_male2.cfg',pos=[-2,0,0])

if(viz.MainWindow.isCulled(avatar)==0):
print 'I See You'

Frank Verberne
10-08-2014, 03:15 AM
It seems that you only check for visibility of the avatar once. You should put the isCulled check in a loop, so that Vizard continuously checks whether the avatar is in view. Hope that helps!

BSUGeek
10-08-2014, 05:56 AM
Thanks that's very helpful. so if i were to make a loop for it to check for visibility until the program stops how would I do that?

Frank Verberne
10-08-2014, 07:12 AM
Use vizact.ontimer(). For more information, see http://docs.worldviz.com/vizard/commands/vizact/ontimer.htm. An example use of vizact.ontimer:

import vizact

def dostuff():
print viz.getFrameNumber()

vizact.ontimer(1,dostuff)

BSUGeek
10-08-2014, 07:44 AM
That worked great! thanks a lot for your help