WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 06-07-2012, 08:40 AM
snovob93 snovob93 is offline
Join Date: Jun 2012
Posts: 6
Phase Space and Proximity Sensors


I'm a student at West Virginia University and working on a project for the summer that involves Phase Space. We want to have an LED sensor on the finger to reach for a 3D virtual target and move to a new location. I was able to connect to Phase Space and link the LED to a marker so it shows up on screen. I was also able to place proximity sensors around a virtual target so that when the LED touches it, it moves to its next location. Its in there as an exitproximity function.
So what we want is that every time the subject reaches for the target it moves to a new location and they have to reach for it again. The issue I'm having is that after the initial reach and move I can't get it to do it again. I mean I could copy and paste a new proximity sensor for each movement, but I have a feeling there could be an easier way. Any ideas at all to speed up the process up would be appreciated!
Reply With Quote
Old 06-11-2012, 05:01 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
Can you post the relevant section of code you are using in your script to handle the proximity sensors?
Reply With Quote
Old 06-12-2012, 08:09 AM
snovob93 snovob93 is offline
Join Date: Jun 2012
Posts: 6
So right now I have to create a whole new sensor to get it to work, which is what I've done here. That is fine, but I don't know how to control it so that the first one will fade out as the new one comes in. With what I did below the first sphere automatically fades out, and the second sphere is always there. I only want one sphere to show up at a time.

However, If there is a way to keep one sensor and get it to move again and again when the marker and sensor touch each other that would be easier.

#Create proximity manager
manager = vizproximity.Manager()

#proximity sensor-sphere
sphereSensor = vizproximity.Sensor(vizproximity.Box([0.5,0.5,0.5],center=[0,0.1,0]),source=sphere)

#Add main viewpoint as proximity target
target = vizproximity.Target(marker2)

#Add viewpoint target to manager

#sphere movement 1
def ExitProximity(e):
PointB = vizact.moveTo([0,1.5,1],speed=2)


#Fade Target 1 out
fadeout = vizact.fadeTo(0,speed=1)

#Load Target 2
sphere2 = viz.add('ball.wrl')
shape = sphere.collideBox()

#proximity sensor-sphere2
sphere2Sensor = vizproximity.Sensor(vizproximity.Box([0.5,0.5,0.5],center=[0,0.1,0]),source=sphere2)

#Add sensors to manager (sphere)

#Sphere movement 2
def ExitProximity2(e):
PointC = vizact.moveTo([0,1.5,-2])

Reply With Quote
Old 06-13-2012, 12:32 PM
snovob93 snovob93 is offline
Join Date: Jun 2012
Posts: 6
New Plan

So what if I make a new sensor every time, and have one fade out when you touch it. As it fades out, we want the new one to come in. Can anyone help me on how to have something fade in depending on the other one fading out?
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 02:11 PM.

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