WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Add a red flash when tracker moves off of a path (https://forum.worldviz.com/showthread.php?t=6181)

amir 08-16-2018 06:39 PM

Add a red flash when tracker moves off of a path
 
We have people walk on a balance beam with an Optotrak rigid body which tracks their movement. We want the display to flash red whenever they step off to the side a certain amount (x-direction). The flash would look like what is available in The Pit script. How can I add this effect for when people step to the side and the rigid body deviates off the path?

I'd also like to be able to toggle this function off and on as the script is running to remove any potential for flashes when need be.

Thanks!

Jeff 08-18-2018 08:23 AM

You could have a proximity sensor around the beam so that when the user moves out of the sensor area the flash is activated.

Jeff 08-18-2018 08:28 AM

To toggle the flash effect add a boolean variable that can be toggled (e.g with keypress). Then only run the flash effect code if the boolean value is true.

amir 08-19-2018 06:58 PM

I defined my event as ToggleRed and got it to work with the proximity sensor.

I added this toggle keypress:

vizact.onkeydown('m',ToggleRed)

However, I'm unable to toggle it off after toggling it on (i.e. it starts off as off, I press 'm' to toggle it on, but then pressing 'm' again doesn't toggle it off).

What am I missing to be able to toggle it both on and off?

Thanks!

Jeff 09-01-2018 01:08 AM

If this has not been resolved please post example code that shows the issue.


All times are GMT -7. The time now is 12:08 PM.

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