Hi
i'm having some trouble with my camera rotation, the camera should rotate around this box when i press the mouse button,
fine, it does that, but when i click, it positions the camera to a completely different angle and starts rotating from there,
i want it to keep the same angle when i click the mouse and then rotate from the same point, its really confusing rotating the camera this way.
Any Ideas on how to do this?
I have looked all over the forums, and its where i found this way of doing rotation, because my mouse will be used to do different things, not just rotate i need it to keep the angle before rotation else it will be extremely frustrating to use.
sync on
sync rate 120
autocam off
global objectnum camy# camx#
objectnum=999
make object triangle objectnum,0,0,0,0,0,0,0,0,0:
make mesh from object 217,objectnum:
add limb objectnum,1,217
offset limb objectnum,1,0,0,-300:
make object cube 10,60
position object objectnum,0,0,0
DO
gosub viewcontrol
SYNC
LOOP
viewcontrol:
CAMY#=CAMY#+mousemovex()*.2
CAMX#=CAMX#+mousemovey()*.2
position camera limb position x(objectnum,1),limb position y(objectnum,1),limb position z(objectnum,1)
point camera object position x(objectnum),object position y(objectnum),object position z(objectnum)
if mouseclick()=1 then xrotate object objectnum,camy# : yrotate object objectnum,camx#
return
Cheers
Adam