![]() |
|
#1
|
|||
|
|||
|
Physics Question
Hi,
Im trying to have a ball fall from a certain height and pass through a floor but have it land on the floor below it. Can anyone explain what I am doing wrong? Thanks Code:
import viz
viz.go()
viz.phys.enable()
viz.MainView.setPosition([0,10,-35]) #sets camera position
viz.MainView.setEuler([0,2,0]) #sets camera pitch
ground1 = viz.add('tut_ground.wrl')
ground1.disable(viz.PHYSICS)
ground2 = viz.add('tut_ground.wrl')
ground2.setPosition([0,-2,0])
ground2.collidePlane()
ball = viz.add('ball.wrl',pos=[0,15,6]) # Add a ball
ballPhys = ball.collideSphere() # Enable physics on ball
|
|
#2
|
|||
|
|||
|
your ground has a collision plane around. I correct you have to remove this line from your code, and then the ball will be passing through the ground.
hope this helped you! Last edited by Moh200jo; 05-05-2009 at 11:40 AM. |
|
#3
|
|||
|
|||
|
You need to specify that the collide plane is at y = -2 to match the y coordinate of ground2
Code:
ground2.collidePlane(0,1,0,-2) |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |
| General question and question regarding arrays | dan12345 | Vizard | 1 | 01-15-2008 10:15 AM |
| another physics question | adimov | Vizard | 1 | 07-22-2004 03:56 PM |
| Physics engine question | adimov | Vizard | 2 | 07-22-2004 12:33 PM |