Goal:
My goal is to rotate the white line as you change the slider value. But it doesn't work! Please assist. Image: Rotation Slider
Effort:
Things I've tried:
rotate
methodrotate
methodframe
f and appending white line to frame and rotating the framefor loop
to continually update the angle of the line.Please assist.
Code: Rotation Slider
Relevant Lines:
c = curve(pos = [vector(-10,0,0),vector(10,0,0)], radius = 0.3)
def setspeed(s):
wt.text = '{:1.0f}'.format(s.value)
sl = slider(min=0, max=360, step = 10, value = 45, bind=setspeed)
wt = wtext(text='{:1.2f}'.format(sl.value))
c.rotate(angle=sl.value, axis = vector(0,0,1), origin = vector(0,0,0))
It looks like the problem is that the rotate function expects angles in radians, not degrees, so you would say angle=radians(sl.value).