hi all, i know this may be a stupid question since nobody answerd this topic, i have a new example
Rem Project: bow phys dark test
Rem Created: Wednesday, March 18, 2009
Rem ***** Main Source File *****
sync on : sync rate 40
set window on
if check display mode(800,600,16)=1 then set display mode 800, 600, 16
if check display mode(800,600,32)=1 then set display mode 800, 600, 32
if check display mode(1024,768,16)=1 then set display mode 1024, 768, 16
if check display mode(1024,768,32)=1 then set display mode 1024, 768, 32
if check display mode(1280,800,16)=1 then set display mode 1280, 800, 16
if check display mode(1280,800,32)=1 then set display mode 1280, 800, 32
set window off
make camera 1 : autocam off : hide mouse
randomize timer()
phy start
center text screen width()/2, screen height()/2, "Did first" : sync : cls
phy make material 1,"first"
phy set material static friction 1,3
phy set material dynamic friction 1,2
phy set material restitution 1,0.5
phy build material 1
center text screen width()/2, screen height()/2, "Did second" : sync : cls
phy make material 2,"second"
phy set material static friction 2,4
phy set material dynamic friction 2,1
phy set material restitution 2,0.3
phy build material 2
center text screen width()/2, screen height()/2, "Did third" : sync : cls
phy make material 3,"third"
phy set material static friction 3,7
phy set material dynamic friction 3,5
phy set material restitution 3,0.6
phy build material 3
center text screen width()/2, screen height()/2, "Did fourth" : sync : cls
phy make material 4,"fourth"
phy set material static friction 4,3
phy set material dynamic friction 4,1
phy set material restitution 4,0.7
phy build material 4
center text screen width()/2, screen height()/2, "Did fifth" : sync : cls
phy make material 5,"fifth"
phy set material static friction 5,2
phy set material dynamic friction 5,8
phy set material restitution 5,0.4
phy build material 5
center text screen width()/2, screen height()/2, "Did ground" : sync : cls
make object box 1, 1000, 10, 1000
position object 1, 500, -20, 500
color object 1, rgb(rnd(255),rnd(255),rnd(255))
phy make rigid body static box 1
center text screen width()/2, screen height()/2, "making boxes" : sync : cls
for x = 100 to 500
make object cube x, 5
position object x, rnd(1000), 1000, rnd(1000)
color object x, rgb(rnd(255),rnd(255),rnd(255))
phy make rigid body dynamic box x, rnd(4)+1
phy set rigid body linear velocity x, 0, rnd(200)-100, 0
phy set rigid body angular velocity x, rnd(100)-50, rnd(100)-50, rnd(100)-50
next x
delay = timer()
arrow = 2
addon = 0
do
gosub controls
gosub arrows
phy update
sync
loop
controls:
XX# = camera position x(1)
YY# = camera position y(1)
ZZ# = camera position z(1)
if keystate(13)=1 then inc YY#
if keystate(12)=1 then dec YY#
rotate camera 1,curvevalue(camera angle x(1)+(mousemovey()/2.0),camera angle x(1),3),curvevalue(camera angle y(1)+(mousemovex()/2.0),camera angle y(1),3),0
if keystate(17)=1 and keystate(30)=1 or keystate(17)=1 and keystate(32)=1 or keystate(31)=1 and keystate(30)=1 or keystate(31)=1 and keystate(32)=1 : step#=3.5 : else : step#=5.0 : endif
`vooruit
if keystate(17)=1 : XF# = newxvalue(camera position x(1), wrapvalue(camera angle y(1)), step#) : ZF# = newzvalue(camera position z(1), wrapvalue(camera angle y(1)), step#) : position camera 1, XF#, YY#, ZF# : endif
`achteruit
if keystate(31)=1 : XB# = newxvalue(camera position x(1), wrapvalue(camera angle y(1)-180), step#) : ZB# = newzvalue(camera position z(1), wrapvalue(camera angle y(1)-180), step#) : position camera 1, XB#, YY#, ZB# : endif
`links
if keystate(30)=1 : XL# = newxvalue(camera position x(1), wrapvalue(camera angle y(1)-90), step#) : ZL# = newzvalue(camera position z(1), wrapvalue(camera angle y(1)-90), step#) : position camera 1, XL#, YY#, ZL# : endif
`rechts
if keystate(32)=1 : XR# = newxvalue(camera position x(1), wrapvalue(camera angle y(1)+90), step#) : ZR# = newzvalue(camera position z(1), wrapvalue(camera angle y(1)+90), step#) : position camera 1, XR#, YY#, ZR# : endif
position camera camera position x(1), YY#, camera position z(1)
if wrapvalue(camera angle x(1))>90 and wrapvalue(camera angle x(1))<180 then xrotate camera 1,90
if wrapvalue(camera angle x(1))>180 and wrapvalue(camera angle x(1))<280 then xrotate camera 1,280
return
arrows:
if mouseclick() = 1 and timer() - delay => 500
make object box arrow+addon, 2, 2, 20
position object arrow+addon, newxvalue(camera position x(1), camera angle y(1), 50), newyvalue(camera position y(1), camera angle x(1), 50), newzvalue(camera position z(1), camera angle y(1), 50)
rotate object arrow+addon, camera angle x(1), camera angle y(1), camera angle z(1)
phy make rigid body dynamic box arrow+addon
phy add rigid body local force arrow+addon, 0, 0, 50, 4
delay = timer() : inc addon
endif
return
no media
this is what i mean. when i shoot de box up, like this: |
the box comes down like this: |
i want it to go like this when i shoot it up: |/-\|
in the order of the dashes
i already tried mass offset, but it only wobbles when it hits the ground. so, any advice? thanks! i really need this..