WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   <window>.isCulled help (https://forum.worldviz.com/showthread.php?t=5181)

BSUGeek 10-07-2014 11:14 AM

<window>.isCulled help
 
Hi everyone,

I'm trying to figure out this .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.


Code:

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/comm...ct/ontimer.htm. An example use of vizact.ontimer:
Code:

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


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

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