Hey what happend I move one above the the phyiscs stuff in my code and an object that was a very dark blue has become a bright pink.
Why ?
this is how it was before and a dark coloured object.
load object "coin.x",id
position object id,0,0,.1
texture object id,1000
rotate object id, 0, 0, 90
phy load rigid body dynamic mesh id,"mesh.mesh",3
phy set rigid body mass id,10
phy set rigid body linear velocity ID, 0,0.1,-0.05
phy set rigid body angular velocity id, 0,0,.75
fix object pivot id
inc id
now with the line fix object pivot id move to before the physics.
id=slot+3+1
load object "coin.x",id
position object id,0,0,.1
texture object id,1000
rotate object id, 0, 0, 90
fix object pivot id
phy load rigid body dynamic mesh id,"mesh.mesh",3
phy set rigid body mass id,10
phy set rigid body linear velocity ID, 0,0.1,-0.05
phy set rigid body angular velocity id, 0,0,.75
inc id
heres the working code.
Rem Project: phypennyfalls3
Rem Created: 04/08/2006 12:19:10
Rem ***** Main Source File *****
phy enable debug
phy start
sync on
sync rate 0
color backdrop 0
autocam off
position camera 0,0,5,-30
global media
global id
global rpin
media=1
makecoinpic()
MakeBackground()
makeFloor()
makesildebox()
makecoinfloor()
makepinslot()
makecoinboxes()
`inc id
oldid=id
phy set auto fixed timing
do
randomize timer()
rem lllllllllllllllllllllllllllllll
glowobj=pick object(mousex(),mousey(),oldid-4,oldid-1)
if glowobj=43
set object ambient 43, 255
set object specular power 43, 255
endif
if glowobj=42
set object ambient 42, 255
set object specular power 42, 255
endif
if glowobj=41
set object ambient 41, 255
set object specular power 41, 255
endif
if glowobj=0
for i=41 to 43
set object ambient i,1
set object specular power i,1
next i
endif
if mouseclick()=0 then pickmode=0 : cursorobj=0
`while mouseclick()=1
`pickmode=0 : cursorobj=0
mclick=mouseclick()
if mclick>0
if pickmode=0
cursorobj=pick object(mousex(),mousey(),oldid-4,oldid-1)
if cursorobj>0
if cursorobj=43 and mclick>0
clone object id,44
position object id,-4,8.3,0
endif
if cursorobj=42 and mclick>0
clone object id,44
position object id,0,8.3,0
endif
if cursorobj=41 and mclick>0
clone object id,44
position object id,4,8.3,0
endif
texture object id,1000
set object ambient id,255
set object specular power id,255
rotate object id, 0, 0, -90
phy make rigid body dynamic convex id,3
phy set rigid body mass id,10
phy set rigid body linear velocity ID, rnd(1),0.1,0
inc id
pickmode=1
endif
endif
endif
` endwhile
rem ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
if z#<3.5 and done<>1
inc z#,.01
else
done=1
endif
if z#>0.0 and done<>0
dec z#,.01
else
done=0
endif
phy set rigid body kinematic position 4, 0, -4.9, z#
control camera using arrowkeys 0,.1,.1
center text screen width()/2,0,"Value of Pot = "+str$(id-oldid+1)+" "+str$(screen fps())
inc x#,.1
if x#<360.0
inc x#,.1
else
x#=0
endif
phy set rigid body kinematic rotation rpin,x#,0,0
phy update
sync
loop
function MakeBackground()
if media = 1
load image "stripe5.png",1
load image "stripe6.png",2
endif
rem create the background object
make object sphere 1,400,48,48
if media = 1
texture object 1,1
else
color object 1,RGB(0,0,255)
endif
scale object texture 1,6,6
set object cull 1,0
rotate object 1,0,0,90
endfunction
function makefloor()
make object plain 2,100,100
if media=1
texture object 2,2
endif
rotate object 2,-90,0,0
position object 2,0,-5,0
phy make rigid body static box 2,3
endfunction
function makecoinfloor()
make object box 3,10,20,2
rotate object 3,-90,0,0
position object 3,0,-4.9,0
phy make rigid body static box 3,2
endfunction
function makesildebox()
make object box 4,10,5,10
position object 4,0,-4.9,0
phy make rigid body dynamic box 4,2
phy set rigid body kinematic 4, 1
endfunction
function makepinslot()
rem front
make object box 5,10,10,.2
position object 5,0,3.2,-.3
ghost object on 5,3
phy make rigid body static box 5,1
rem back
make object box 6,10,11,2
position object 6,0,2.5,1.3
color object 6,RGB(255,255,0)
rem make pins
phy make rigid body static box 6
rem make side walls <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
rem left
make object box 7,10,15,.2
rotate object 7,0,90,0
position object 7,-5,0,-4.2
ghost object on 7,3
phy make rigid body static box 7,1
rem right
make object box 8,10,15,.2
rotate object 8,0,90,0
position object 8,5,0,-4.2
ghost object on 8,3
phy make rigid body static box 8,1
rem make pins >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
pins=9
make object cube pins,1
scale object pins,10,10,100
rotate object pins,0,0,45
position object pins,0,0,0.1
phy make rigid body static box pins,3
xp=-.3
for mpins=pins to pins+30
clone object mpins+1,pins
next mpins
position object pins+1,1.5,0,0.1
position object pins+2,3,0,0.1
position object pins+3,4.5,0,0.1
position object pins+4,-1.5,0,0.1
position object pins+5,-3,0,0.1
position object pins+6,-4.5,0,0.1
position object pins+7,.75,1.5,0.1
position object pins+8,2.25,1.5,0.1
position object pins+9,3.75,1.5,0.1
position object pins+10,-.75,1.5,0.1
position object pins+11,-2.25,1.5,0.1
position object pins+12,-3.75,1.5,0.1
position object pins+13,1.5,3,0.1
position object pins+14,3,3,0.1
position object pins+15,4.5,3,0.1
position object pins+16,-1.5,3,0.1
position object pins+17,-3,3,0.1
position object pins+18,-4.5,3,0.1
position object pins+19,.75,4.5,0.1
position object pins+20,2.25,4.5,0.1
position object pins+21,3.75,4.5,0.1
position object pins+22,-.75,4.5,0.1
position object pins+23,-2.25,4.5,0.1
position object pins+24,-3.75,4.5,0.1
position object pins+25,1.5,6,0.1
position object pins+26,3,6,0.1
position object pins+27,4.5,6,0.1
position object pins+28,-1.5,6,0.1
position object pins+29,-3,6,0.1
position object pins+30,-4.5,6,0.1
position object pins+31,0,6,0.1
color object pins+31,RGB(0,255,0)
rpin=pins+31
phy make rigid body dynamic box rpin
phy set rigid body kinematic rpin, 1
for mpins= pins+1 to pins+30
phy make rigid body static box mpins,3
next mpins
id= pins+31
endfunction
function makecoinboxes()
slot=id
make object cube slot+1,1
make object cube slot+2,1
make object cube slot+3,1
position object slot+1,4,9,0
position object slot+2,0,9,0
position object slot+3,-4,9,0
texture object slot+1,1003
texture object slot+2,1002
texture object slot+3,1001
for g=41 to 43
ghost object on g,4
next g
id=slot+3+1
load object "coin.x",id
position object id,0,0,.1
texture object id,1000
rotate object id, 0, 0, 90
fix object pivot id
phy load rigid body dynamic mesh id,"mesh.mesh",3
phy set rigid body mass id,10
phy set rigid body linear velocity ID, 0,0.1,-0.05
phy set rigid body angular velocity id, 0,0,.75
inc id
endfunction
function makecoinpic()
cls RGB(0,0,255)
set text size 50
center text 0,0,"50"
get image 1000,0,0,50,50,1
cls RGB(255,0,0)
ink rgb(255,255,255),0
center text 25,0,"3"
get image 1003,0,0,50,50,1
cls RGB(0,255,0)
ink rgb(255,255,255),0
center text 25,0,"2"
get image 1002,0,0,50,50,1
cls RGB(0,0,255)
ink rgb(255,255,255),0
center text 25,0,"1"
get image 1001,0,0,50,50,1
set text size 12
concrete=3
phy make material concrete,"concrete"
phy set material static friction concrete,0.75
phy set material dynamic friction concrete,1.75
phy set material restitution concrete,0.1
phy build material concrete
glass=1
phy make material glass,"glass"
phy set material static friction glass,0.1
phy set material dynamic friction glass,0.1
phy set material restitution glass,0.25
phy build material glass
hardwood=2
phy make material hardwood,"hardwood"
phy set material static friction hardwood,0.4
phy set material dynamic friction hardwood,0.4
phy set material restitution hardwood,0.2
phy build material hardwood
endfunction
I gather its do the dBPro code frist then the Physics but way was it such a big change in looks.
I'm not getting you down am I, Ho Look! another fancy Door?