WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

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

Hello,

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
  #2  
Old 06-11-2012, 06: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
  #3  
Old 06-12-2012, 09:09 AM
snovob93 snovob93 is offline
Member
 
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()
manager.setDebug(viz.ON)


#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
manager.addTarget(target)

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


manager.onExit(sphereSensor,ExitProximity)

#Fade Target 1 out
fadeout = vizact.fadeTo(0,speed=1)
vizact.onbuttondown('f',fadeout)
sphere.addAction(fadeout)

#Load Target 2
sphere2 = viz.add('ball.wrl')
shape = sphere.collideBox()
sphere2.setPosition([0,1.5,1])
viztask.waitActionEnd(sphere2,fadeout)

#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)
manager.addSensor(sphereSensor)
manager.addSensor(sphere2Sensor)

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

manager.onExit(sphere2Sensor,ExitProximity2)
Reply With Quote
  #4  
Old 06-13-2012, 01:32 PM
snovob93 snovob93 is offline
Member
 
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
Reply


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 09:40 AM.


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