use point object(id)
here is a example
setupmain()
do
spherecontrol()
pointobject()
loop
function spherecontrol()
`controls the sphere
if upkey()
move object 2,.1
endif
if downkey()
move object 2,-.1
endif
if rightkey()
move object right 2,.1
endif
if leftkey()
move object left 2,.1
endif
if shiftkey()
move object up 2,.1
endif
if controlkey()
move object down 2,.1
endif
`Repsition sphere back to starting position
if spacekey() = 1
position object 2,-90,0,0
endif
endfunction
function setupmain()
`makes the sphere,cube and places the camera
color backdrop RGB(0,0,0)
set ambient light 50
make object cube 1,30
position object 1,0,0,0
color object 1,RGB(0,0,255)
make object sphere 2,30
position object 2,-90,0,0
color object 2,RGB(255,0,0)
position camera 0,0,300,0
point camera 0,0,0,0
endfunction
function pointobject()
`Gets position of the sphere
sphereposx# = object position x(2)
sphereposy# = object position y(2)
sphereposz# = object position z(2)
`Points cube as spheres position
point object 1,sphereposx#,sphereposy#,sphereposz#
`Gets angle that the cube is at relative to the position of the sphere
cubeanglex# = object angle x(1)
cubeangley# = object angle y(1)
cubeanglez# = object angle z(1)
`prints info
set cursor 0,0
print "arrow to move sphere " : print "shift and control up and down" : print "spacekey to reset sphere pos"
print "cube angle x ",cubeanglex#
print "cube angle Y ",cubeangley#
print "cube angle z ",cubeanglez#
print "sphere pos x",sphereposx#
print "sphere pos y ",sphereposy#
print "sphere pos z ",sphereposz#
endfunction
Your signature has been erased by a mod -- please resize to under 600x120...