Vizard 7 » Tutorials & Examples » Viewpoints & windows » Viewpoint collision » Tutorial: Gravity
7.6

Tutorial: Gravity

Vizard will automatically implement gravity for you and animate the viewpoint falling back down. The force of gravity is initially set to simulate the effect of gravity on earth, which is 9.8 m/sec². However you can change the force of gravity to whatever you like.

 

To make gravity weak add the following line to the end of you script:

viz.MainView.gravity(2)

Run the script and go up the ramp and fall off of it.

 

Notice how it takes longer for the viewpoint to reach the ground.

 

To make gravity stronger try setting it to 30, this will make you reach the ground a lot faster.

Setting up a collision world

Enabling collision detection

Gravity

Step height