I'm trying to get two stars to orbit each other around a common center of gravity, It took a little while but I got it, but when I tried to setup a new limb strcture for the planets I can the error limb does not extist.
Is it possible to have two seperate limb structures in the same app.?
thanks for your time.
sync on : sync rate 0
set text font "arial" : set text size 176
set text to bold : set text transparent
SET DISPLAY MODE 1024, 768, 32
LOAD OBJECT "media/sky.x",1000
ROTATE OBJECT 1000, 90, 0, 0
position object 1000, 0,0,0
SCALE OBJECT 1000,19000,19000,19000
LOAD IMAGE "media/spacesph.tga", 1
LOAD IMAGE "media/red.tga", 2
LOAD IMAGE "media/yellowdwarf.tga", 3
LOAD IMAGE "media/bluedwarf.tga", 4
LOAD IMAGE "media/browndwarf.tga", 5
LOAD IMAGE "media/whitedwarf.tga", 6
LOAD IMAGE "media/neutron.tga", 7
SET CAMERA RANGE 0,.1, 200000
SET AMBIENT LIGHT 0
MAKE LIGHT 1
COLOR LIGHT 1, 256, 256, 256
SET LIGHT RANGE 1, 1000000
MAKE LIGHT 2
COLOR LIGHT 2, 256, 256, 256
SET LIGHT RANGE 2, 1000000
stardistancex#=rnd(100)
stardistancez#=rnd(100)
starborbitrate#=30/(stardistancex#+stardistancez#)
stardistancebx#=(stardistancex#/5)*-1
stardistancebz#=(stardistancez#/5)*-1
planetdistancex#=rnd(200)
planetdistancez#=rnd(200)
planetborbitrate#=10/(planetdistancex#+planetdistancez#)
`grav center
LOAD OBJECT "media/gravcenter.x",1
position object 1, 0,0,0
HIDE OBJECT 1
LOAD OBJECT "media/star1a.x",2
SCALE OBJECT 2,70,70,70
make mesh from object 1,2
add limb 2,1,1
link limb 2,0,1
offset limb 2,1,stardistancex#,0,stardistancez#
LOAD OBJECT "media/star1a.x",3
SCALE OBJECT 1,-20,-20,-20
make mesh from object 2,3
add limb 3,1,2
link limb 3,0,1
offset limb 3,1,stardistancebx#,0,stardistancebz#
TEXTURE LIMB 3, 1, 5
TEXTURE LIMB 2, 1, 3
HIDE LIMB 3, 0
hide limb 2, 0
`ghost sun
LOAD OBJECT "media/star1a.x",4
SCALE OBJECT 4,-20,-20,-20
LOAD OBJECT "media/planet1.x",5
SCALE OBJECT 5,0,0,0
make mesh from object 5,5
add limb 5,1,5
link limb 5,0,4
offset limb 5,1,planetdistancex#,0,planetdistancez#
HIDE LIMB 5, 0
SET OBJECT LIGHT 2, 1
SET OBJECT LIGHT 3, 1
position camera 0, 85, 85
do
sun1posx#=OBJECT POSITION X(3)
sun1posy#=OBJECT POSITION y(3)
sun1posz#=OBJECT POSITION z(3)
sun2posx#=OBJECT POSITION X(2)
sun2posy#=OBJECT POSITION y(2)
sun2posz#=OBJECT POSITION z(2)
cam1y#=CAMERA POSITION Y(0)
cam1x#=CAMERA POSITION x(0)
cam1z#=CAMERA POSITION Z(0)
limb1y#=LIMB ANGLE Y(2, 0)
limb2y#=LIMB ANGLE Y(3, 0)
planetlimb1y#=LIMB ANGLE Y(5, 0)
ROTATE LIMB 2, 0, 0, limb1y#+starborbitrate#, 0
ROTATE LIMB 3, 0, 0, limb2y#+starborbitrate#, 0
ROTATE LIMB 5, 0, 0, planetlimb1y#+planetborbitrate#, 0
position object 4, sun1posx#, sun1posy#, sun1posz#
POSITION LIGHT 1, sun1posx#, sun1posy#, sun1posz#
POSITION LIGHT 1, sun2posx#, sun2posy#, sun2posz#
sync
loop
end