Hi All,
I'm confused, have set up my object how I wanted before adding any phy commands, but when I do all the z positioning need changing,
eg
before
position object 1,0,-1.5,0
after
position object 1,0,-1.5,-4
Why anybody?
the code i am using, press s for side view a for above.
Rem ***** Main Source File *****
sync on : sync rate 0 :
color backdrop rgb(0,0,0)
set text font "arial" : set text size 12
autocam off
position camera 0,0,15,-56
rotate camera 0,0,0,0
phy start
`position camera 0,0,90,0
`rotate camera 0,90,0,0
makebaseframe()
makebaseboard()
makeskittles()
makeswingpole()
makeballandcord()
do
if inkey$()="s"
position camera 0,0,15,-56
rotate camera 0,0,0,0
endif
if inkey$()="a"
position camera 0,0,90,0
rotate camera 0,90,0,0
endif
`text 0,0,str$(object position x(21))
`text 0,10,str$(object position y(21))
`text 0,20,str$(object position z(21))
phy update
sync
loop
function makebaseframe()
rem base
make object box 1,43,1,43
position object 1,0,-10,0
color object 1,RGB(128,128,64)
phy make rigid body static box 1
rem back bar
make object box 2,43,5,1
position object 2,0,-8,21.5
phy make rigid body static box 2
rem front bar
make object box 3,43,5,1
position object 3,0,-8,-21.5
phy make rigid body static box 3
rem left bar
make object box 4,1,5,43.2
position object 4,-21.5,-8,0
phy make rigid body static box 4
rem right bar
make object box 5,1,5,43.2
position object 5,21.5,-8,0
phy make rigid body static box 5
endfunction
function makebaseboard()
make object box 10,23,1.5,23
position object 10,0,-8.5,0
rotate object 10,0,45,0
phy make rigid body static box 10
endfunction
function makeskittles()
y#=-1.6
make object cylinder 20,9
scale object 20,35,100,35
position object 20,0,y#,0
clone object 21,20
position object 21,11,y#,0
`clone object 22,20
`position object 22,-11,y#,0
`clone object 23,20
`position object 23,0,y#,-14
`clone object 24,20
`position object 24,0,y#,0
`clone object 25,20
`position object 25,6,y#,-9.5
`clone object 26,20
`position object 26,-6,y#,-9.5
`clone object 27,20
`position object 27,-6,y#,3
`clone object 28,20
`position object 28,-4,y#,-16
for id = 20 to 21
phy make rigid body dynamic capsule id
phy set rigid body gravity id, 1
next id
endfunction
function makeswingpole()
make object cylinder 30,75
position object 30,-21.5,27,0
scale object 30,2,100,2
phy make rigid body static box 30
endfunction
function makeballandcord()
make object sphere 40,3.7
position object 40,-21.5,-4,-3
phy make rigid body dynamic sphere 40
make object box 100,2.5,.5,.5
position object 100,0,10,0
make object box 101,.5,1.2,.5
position object 101,1.2,9.7,0
endfunction
Dark Physics makes any hot drink go cold.