WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-06-2010, 07:40 AM
bloswald bloswald is offline
Member
 
Join Date: Jan 2010
Posts: 7
Show Physics Shapes

I have many different objects in my augmented reality environment with different collide shapes. Is there a way to make the physics shapes visible or transparent? It would make debugging a lot easier if I could see the shapes somehow.

Thanks!
-
bloswald
Reply With Quote
  #2  
Old 04-06-2010, 11:35 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Take a look at the collideBox and collideSphere examples in the following page:

http://www.worldviz.com/vizhelp/Shapes.htm

They show ways to do this for certain objects which are centered at 0,0,0.
Reply With Quote
  #3  
Old 04-07-2010, 07:13 AM
bloswald bloswald is offline
Member
 
Join Date: Jan 2010
Posts: 7
Quote:
Originally Posted by Jeff View Post
They show ways to do this for certain objects which are centered at 0,0,0.
Is there a way to do this for objects not centered at the origin? I am just curious about collideBoxes and collideSpheres mostly. I realize that showing a collideMesh might be difficult.

-
bloswald
Reply With Quote
  #4  
Old 04-07-2010, 03:16 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You would have to adjust the position of the box or sphere used to visualize the collision area.

In the following example the avatar origin is at the bottom of his feet so the box does appear to be in the correct position. Hit the spacebar to adjust the position of the box.
Code:
import viz
viz.go()

viz.clearcolor(viz.SKYBLUE)

ground = viz.add('tut_ground.wrl')

logo = viz.add('logo.wrl',pos=[-1,1.5,6],euler=[0,0,30])
logo.collideBox() 

logo.add('box.wrl',alpha=.2,scale=logo.getBoundingBox(viz.REL_LOCAL).size) 

avatar = viz.add('vcc_male.cfg',pos=[1,0,6],euler=[180,0,0])
avatar.collideBox() 

box = avatar.add('box.wrl',alpha=.2,scale=avatar.getBoundingBox(viz.REL_LOCAL).size)  

vizact.onkeydown(' ',box.setPosition,[0,.9,0])

import vizcam
viz.cam.setHandler(vizcam.PivotNavigate(center=[0,1,6],distance=5))
The collideMesh area is the same as the object itself so it is not necessary to build anything to visualize it.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show flight path of balls snoopy78 Vizard 1 08-28-2009 02:57 PM
physics engine exception ad_astra Vizard 3 03-25-2009 11:31 AM
Physics and Haptics jalvarez Vizard 3 07-16-2008 03:03 PM
another physics question adimov Vizard 1 07-22-2004 03:56 PM
Physics engine question adimov Vizard 2 07-22-2004 12:33 PM


All times are GMT -7. The time now is 12:23 PM.


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