WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 07-03-2006, 06:00 AM
giancamati giancamati is offline
Join Date: Jun 2006
Posts: 27
Talking bounding box....

Hello everybody, due to my ignorance in programming with Vizard I am trying to visualized the bounding box of a picked object. I wish to visualize it in red. I tryed with the following gode:
pickedOBJ = viz.pick()

if pickedOBJ.valid():
print 'Oggetto CATTURATO'
if pickedOBJ == box:

Is that right?
Thank you.
Giancarlo Amati
Reply With Quote
Old 07-03-2006, 12:20 PM
Gladsomebeast Gladsomebeast is offline
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Here is some code that visualizes a bounding box.

import viz
import vizact


box = viz.add( 'box.wrl' )
box.alpha( .2 )
box.color( viz.RED )

def drawborder(obj ):
	savedEuler = obj.get( viz.EULER )
	obj.rotate( 0, 0, 0 )
	bb = obj.get( viz.BOUNDING_BOX, viz.RELATIVE_LOCAL )
	obj.rotate( savedEuler )
	box.translate( bb[3:7] )
	box.rotate( obj.get( viz.EULER ) )
	box.scale( bb[0:3] )

logo = viz.add( 'logo.wrl' )

logo.add( vizact.goto( 0, 0, 10, 10 ) )
logo.add( vizact.spin( 0, 1, 0, 45, viz.FOREVER ), 1 )

def onTimer(num):
	drawborder( logo )

viz.starttimer( 0, 0, viz.FOREVER )
Paul Elliott
WorldViz LLC
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:53 PM.

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