I'm trying to get a camera to follow an object, but once the object is linked to a parent limb and the camera is set to the limbs position (can't use the objects postion is always returns a "0") the limb disappears sometimes, other times it stopps the motion of the limb. Is there a bug with the camera and limbs?
I'm very greatful for any help, Thanks again.
Rem Project: extra stellar camera test
Rem Created: 12/1/2007 7:27:44 AM
Rem ***** Main Source File *****
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
SET CAMERA RANGE 0,.1, 200000
SET AMBIENT LIGHT 0
stardistancex#=rnd(100)
stardistancez#=rnd(100)
starborbitrate#=30/(stardistancex#+stardistancez#)
stardistancebx#=(stardistancex#/5)*-1
stardistancebz#=(stardistancez#/5)*-1
`grav center
MAKE OBJECT SPHERE 1, 10
position object 1, 0,0,0
HIDE OBJECT 1
MAKE OBJECT SPHERE 2, 10
make mesh from object 1,2
add limb 2,1,1
link limb 2,0,1
offset limb 2,1,stardistancex#,0,stardistancez#
MAKE OBJECT SPHERE 3, 10
make mesh from object 2,3
add limb 3,1,2
link limb 3,0,1
offset limb 3,1,stardistancebx#,0,stardistancebz#
HIDE LIMB 3, 0
hide limb 2, 0
do
sun1posx#=limb POSITION X(3,1)
sun1posy#=limb POSITION y(3,1)
sun1posz#=limb POSITION z(3,1)
sun2posx#=limb POSITION X(2,1)
sun2posy#=limb POSITION y(2,1)
sun2posz#=limb POSITION z(2,1)
limb1y#=LIMB ANGLE Y(2, 0)
limb2y#=LIMB ANGLE Y(3, 0)
ROTATE LIMB 2, 0, 0, limb1y#+starborbitrate#, 0
ROTATE LIMB 3, 0, 0, limb2y#+starborbitrate#, 0
position camera sun1posx#-55, 5, sun1posz#+55
point camera sun2posx#,0,sun2posz#
sync
loop
end