This can be done by assigning the restitution of the ball and the surface it is bouncing on to 1.0
I have modifed the restitution example to demonstrate
` in this example program we see how restitution affects objects
` set up the program
phy start
autocam off
sync on
sync rate 60
color backdrop 0
position camera 0, 20, -70
rem stripe textures
load image "stripe5.png",8
make object sphere 8,400,48,48
texture object 8,8
scale object texture 8,6,6
set object cull 8,0
load image "stripe6.png",1
` make a bouncy material
phy make material 1, "very bouncy"
phy set material restitution 1, 1.0
phy build material 1
` make a less bouncy material
phy make material 2, "less bouncy"
phy set material restitution 2, 0.5
phy build material 2
` and finally a material with no bounce
phy make material 3, "no bounce"
phy set material restitution 3, 0.0
phy build material 3
` create sphere with bouncy material
make object sphere 2, 5
position object 2, -20, 30, 0
phy make rigid body dynamic sphere 2, 1
` create sphere with less bouncy material
make object sphere 3, 5
position object 3, 0, 30, 0
phy make rigid body dynamic sphere 3, 2
` create sphere with no bounce material
make object sphere 4, 5
position object 4, 20, 30, 0
phy make rigid body dynamic sphere 4, 3
` create our ground object
make object box 1, 50, 1, 50
texture object 1,1
phy make rigid body static box 1,1
` colour all objects
for i = 2 to 4
color object i, rgb ( rnd ( 255 ), rnd ( 255 ), rnd ( 255 ) )
set object specular i, rgb ( rnd ( 255 ), rnd ( 255 ), rnd ( 255 ) )
set object specular power i, 255
set object ambient i, 0
next i
load image "logo.png", 100000
sprite 1, 0, 600 - 60, 100000
do
center text object screen x ( 2 ), object screen y ( 2 ) - 40, "very bouncy"
center text object screen x ( 3 ), object screen y ( 3 ) - 40, "less bouncy"
center text object screen x ( 4 ), object screen y ( 4 ) - 40, "no bounce"
phy update
sync
loop
all I did was move the "floor" to after the materials were defined and assigned the material "very bouncy" to it
All the best
Codger
System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem