WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-29-2015, 02:38 AM
lalechuza lalechuza is offline
Member
 
Join Date: Jun 2015
Posts: 7
sensor radius bug?

Hey there!

I am using the circleArea proximity sensor so one can "collect" objects.
I want the difference between the radius of the object and the radius of the sensor to be constant. Therefore I pass the radius of the object plus my constant value to the circleArea sensor and then link the sensor to the object.
Before you start the programm you can change the transformation of the object that will be "collected".
Now here is my Problem:
When I scale the object the sensor is much bigger (or smaller) as it should be. I think its because I linked the sensor and the object. But I need the link so I can easily let the object disappear, when someone "collects" it.

To show my problem I wrote an example, where I just pass a constant to the sensor and it still gets much bigger as the one of the non-scaled object:

Code:
import viz
import vizshape
import vizproximity

viz.setMultiSample(4)
viz.fov(60)
viz.go()

viz.MainView.setPosition(0,5,-4)
viz.MainView.setEuler(0,45,0)

manager = vizproximity.Manager()
#to see the circleArea
manager.setDebug(viz.ON)

purpleCylinder = vizshape.addCylinder(height=2.0,radius=0.3,topRadius=None,bottomRadius=None,yAlign=vizshape.ALIGN_MIN,slices=20,bottom=True,top=True)
purpleCylinder.color(viz.PURPLE)
purpleCylinder.setPosition(-2.5,0,0)
#non-scaled purple cylinder
purpleSensor = vizproximity.CircleArea(radius=0.7)
#link sensor to the object
linkedPurpleSensor = vizproximity.Sensor(purpleSensor, purpleCylinder)
manager.addSensor(linkedPurpleSensor)
print 'purple: ', linkedPurpleSensor

redCylinder = vizshape.addCylinder(height=2.0,radius=0.3,topRadius=None,bottomRadius=None,yAlign=vizshape.ALIGN_MIN,slices=20,bottom=True,top=True)
redCylinder.color(viz.RED)
redCylinder.setPosition(1,0,0)
#scale the second red cylinder up
redCylinder.setScale(4,4,4)
redSensor = vizproximity.CircleArea(radius=0.7)
#link sensor to the object
linkedRedSensor = vizproximity.Sensor(redSensor, redCylinder)
manager.addSensor(linkedRedSensor)
print 'red: ', linkedRedSensor
the print says the radius is the same in both:
purple: Sensor(shape=CircleArea(radius=0.7, center=(0.0, 0.0)), source=NodeSource(node=viz.VizPrimitive(2), flag=4, name=''))
red: Sensor(shape=CircleArea(radius=0.7, center=(0.0, 0.0)), source=NodeSource(node=viz.VizPrimitive(4), flag=4, name=''))

Can someone tell me what happened? Am I doing something wrong or is it a bug?
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 12:40 PM.


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