Notifications
Clear all
[Closed] Spinner and Timer
Mar 15, 2017 12:48 pm
Hi everybody
I try to rotate an object around another object (as denis guide me the other day ) using a timer and the a spinner which controls the speed of rotation and another spinner as pivot position, But notice that while i’m increasing the value of both spinners as speed or pivot position there is a pause on rotation of the box .
mybox = box height:15 width:15 length:15 name:"Go_round"
objPivot = circle radius:30
rollout unnamedRollout "Untitled" width:162 height:100
(
spinner 'speed' "speed" pos:[2,15] width:136 height:16 range:[-100,100,0] scale:1 ticks:100 align:#left
spinner 'possitio_n' "Position" pos:[2,45] width:136 height:16 range:[-100,100,0] scale:1 ticks:100 align:#left
Timer 'mytimer' "" pos:[13,250] width:24 height:24 interval:1 active:false align:#left
on speed changed val do
(
mytimer.active = true
if speed.value==0 do (mytimer.active = false)
)
on possitio_n changed val do
(
objPivot.pos.x = val
)
on mytimer tick do
(in coordsys $Go_round about $Circle001 rotate $Go_round ( eulerangles 0 0 (( speed.value)/10 ) ) )
)
CreateDialog unnamedRollout
I mean the box stops until i release the spinner. It happens even i try to increase the height of the box even in max create tab. Don’t know max is waiting for the spinner value ? or …
Is there any better way to do this ?
Thanks in advance.