#1
|
|||
|
|||
black outs
I am running my world, and it will black out on the rendering for 1-6 seconds at a time. There are no error messages associated with this, and the program keeps on running fine in the background during the black outs (I can hear the sound files being played etc). What could be causing the black outs and what can I do to stop them? I have 8 avatars in the world along with "gaze" lines. The lines are updated every tenth of a second to show where they are looking. (Using math.tan in the calculation of where they are looking). It blacks out even when I'm not moving around in the world, just watching from a stationary point.
|
#2
|
|||
|
|||
Not a lot of information to go on. How do you see the gaze lines if it's blacked out? Are there any models near the camera (like the head or avatar you're viewing from) which you could hide as a test? Any other specifics you can offer?
|
#3
|
|||
|
|||
The world contains 8 avatars and 8 lines ( see http://www.worldviz.com/forum/showthread.php?t=570 as to how I made the lines ). There is a timer that makes the lines update every tenth of a second so that they are aligned with where each avatar head is looking. When the screen blacks out, it's entirely black, can't see anything. The camera viewpoint has been in several locations about the room when it has blacked out. I've moved around (using the mouse) while it's blacked out and I will end up in a new place when it's no longer blacked out, but the simple moving doesn't seem to stop it. I did not have this problem with this world prior to adding the gaze lines. Therefore, I'm guessing the black outs have something to do with the program not being able to handle updating the lines so frequently.
Perhaps there is a better way to indicate the gaze of the avatars? |
#4
|
|||
|
|||
Hi,
If your script isn't too complex, would you mind posting it or sending it to me at lashkari@worldviz.com ? Are you using any plugins or tracking sensors in your script? |
#5
|
|||
|
|||
The script is somewhat long, I can e-mail you the file, but here are the gaze relevant parts:
Code:
def loadGazes(): global people, peopleGaze, peopleGazeInit for i in range( NUMBER_PEOPLE ): [ x, y, z ] = peopleAvatars[ i ].getpos() fromCenter = i - NUMBER_PEOPLE/2 degrees = 7 * math.fabs( fromCenter ) if( fromCenter > 0 ): degrees = 360 - degrees y = 1.4 viz.startlayer( viz.LINES ) viz.linewidth( 1 ) gazeOrigin = viz.vertex( x, y, z ) gazeEnd = viz.vertex( x + math.tan( math.radians( degrees ) )*GAZE_LENGTH, y, z + GAZE_LENGTH ) gaze = viz.endlayer() gaze.color( viz.BLUE ) gaze.alpha( 0.3 ) gaze.dynamic() if( i == PARTICIPANT_POSITION ): gaze.visible( False ) peopleGazeInit.append( [ x + math.tan( math.radians( degrees ) )*GAZE_LENGTH, y, z + GAZE_LENGTH ] ) peopleGaze.append( gaze ) Code:
def updateGaze(): global peopleGaze, peopleGazeInit for i in range( NUMBER_PEOPLE ): if( not i == PARTICIPANT_POSITION ): [ yaw, pitch, roll ] = peopleAvatars[ i ].getbone( 'skel_Head' ).get( viz.EULER ) peopleGaze[ i ].vertex( 1, peopleGazeInit[ i ][ 0 ] + math.tan( math.radians( yaw ) )*GAZE_LENGTH, peopleGazeInit[ i ][ 1 ] - math.tan( math.radians( pitch ) )*GAZE_LENGTH, peopleGazeInit[ i ][ 2 ] ) Code:
def timer( timerID ): if( timerID == TIMER_UPDATE_GAZE ): updateGaze() viz.callback( viz.TIMER_EVENT, timer ) Code:
loadGazes() viz.starttimer( TIMER_UPDATE_GAZE, 1.0/10.0, viz.FOREVER ) Code:
import vizinfo import whrandom import math if viz.running(): import sid #has to be imported for the gamepad |
|
|