Quote: "One point of inquery is, once you rotate too far either left or right, the cube disappears entirely. It's not that it's a complaint, but I just wonder what causes it, do you know? ^_^ "
It looks like the OFFSET LIMB command is causing it. My guess would be that the camera sometimes thinks the object is offscreen even when it's not and gets confused when culling... but I honestly have no idea
. Here's a work-around though. Instead of using OFFSET LIMB I offset the object from the camera's position manually in the loop:
`Set up screen refresh
sync on : sync rate 60
`Make a button to click
make object box 1,4,2,1
`Offsetting the object will make it easier to position in front of the camera
`offset limb 1,0,-4,-3,10 `It will be offset later on. Check the loop code.
disable object zdepth 1 `Makes it always show in front of other objects
`Make a matrix as a frame of reference
make matrix 1,100,100,10,10
position matrix 1,-50,0,-50
`Set up camera
position camera -20,30,-20
`MAIN LOOP
do
`See if the button is clicked
if mouseclick()=1
temp=pick object(mousex(),mousey(),1,1)
`If it is, change its color
if temp>0
color object 1,rgb(255,0,0)
endif
endif
`Change it back when the click is released
if mouseclick()=0
texture object 1,0
endif
`Guess what this does :P
control camera using arrowkeys 0,0.25,0.5
`Reposition the button so it's always in front of the camera
rotate object 1,camera angle x(),camera angle y(),0
position object 1,camera position x(),camera position y(),camera position z()
`Offset it manually instead of using OFFSET LIMB.
move object 1, 10.0
move object left 1, 4.0
move object down 1, 3.0
sync
loop
Guns, cinematics, stealth, items and more!