WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   checking object location in an inclosed area of the world (https://forum.worldviz.com/showthread.php?t=3004)

Chapre 10-06-2010 11:42 PM

checking object location in an inclosed area of the world
 
Hello, is are there function that can help me check if an object is inside an area or inside another object.
illustration 1: how will I check if a wheelchair is inside the train or inside house
illustration 2: how will I check if a wheelchair is inside an inclosed area in the world

farshizzo 10-07-2010 12:48 PM

If you have the bounding box the enclosed area and the position of the wheelchair, then you can use the following code to check whether the wheelchair is inside the enclosed area:
Code:

# bb is bounding box of enclosed area
# p is [x,y,z] position of wheelchair

if (bb.xmin <= p[0] <= bb.xmax) and (bb.ymin <= p[1] <= bb.ymax) and (bb.zmin <= p[2] <= bb.zmax):
        print 'Wheelchair inside'
else:
        print 'Wheelchair outside'


Chapre 10-08-2010 12:57 AM

Thanks a lot farshizzo, this is what I needed


All times are GMT -7. The time now is 03:58 PM.

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