#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
Quote:
- bloswald |
#4
|
|||
|
|||
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)) |
|
|
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 |