I think I know what u need
Something like this:
// set window properties
SetWindowTitle("Drag 3D Object")
SetWindowSize(1024,768,0)
// set display properties
SetVirtualResolution(100,100)
SetOrientationAllowed(1,1,1,1)
SetSyncRate(60,0) // 30fps instead of 60 to save battery
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetClearColor(104,104,204)
ClearPointLights()
SetScissor(0,0,0,0)
global startx#
global starty#
global angx#
global angY#
global DistX#
global DistY#
global NewX#
global NewY#
ObjectID=CreateObjectBox(5,5,5)
do
DragObject(ObjectID)
sync()
loop
function DragObject(ObjectID)
// rotate the camera
if (GetPointerPressed())
startx#=GetPointerX()
starty#=GetPointerY()
angx#=GetObjectAngleX(ObjectID)
angy#=GetObjectAngleY(ObjectID)
endif
if (GetPointerState()=1)
DistX#=(GetPointerX()-startx#)
DistY#=(GetPointerY()-starty#)
endif
print(DistX#)
print(DistY#)
NewX#=CurveAngle(angy#-DistX#,NewX#,4)
NewY#=CurveAngle(angx#-DistY#,NewY#,4)
SetObjectRotation(ObjectID,NewY#,NewX#,0)
endfunction
function CurveAngle(DestinationAngle#,CurrentAngle#,Steps#)
Diff#=WrapValue(CurrentAngle#-DestinationAngle#)
if Diff#<180
Diff#=-Diff#
else
Diff#=360-Diff#
endif
NewValue#=WrapValue(CurrentAngle#+Diff#/Steps#)
//~ Time#=GetFrameTime()
//~ NewValue#=WrapValue(CurrentAngle#+(Diff#*((Steps#^Time#-(Steps#-1)^Time#)/(Steps#^Time#))))
endfunction NewValue#
function WrapValue(angle#)
if angle#<0
angle#=angle#+360
endif
if angle#>360
angle#=angle#-360
endif
endfunction angle#