WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 10-06-2010, 11:42 PM
Chapre Chapre is offline
Join Date: Sep 2010
Posts: 36
Question 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

Last edited by Chapre; 10-06-2010 at 11:47 PM.
Reply With Quote
Old 10-07-2010, 12:48 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
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:
# 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'
	print 'Wheelchair outside'
Reply With Quote
Old 10-08-2010, 12:57 AM
Chapre Chapre is offline
Join Date: Sep 2010
Posts: 36
Thanks a lot farshizzo, this is what I needed
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
why is time faster in my virtual world? billjarrold Vizard 1 11-24-2009 05:33 PM
Gps input for viewpoint location? realvision Vizard 3 03-19-2008 12:37 PM
Object rotating around world axis, not own axis tacbob Vizard 1 02-15-2007 09:12 AM
rotate to object jargon Vizard 1 08-08-2005 12:20 PM

All times are GMT -7. The time now is 05:39 AM.

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