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:
- Drawing white line as a curve and rotating the curve with
rotatemethod - Drawing white line as an arrow and rotating arrow with
rotatemethod - Establishing a
framef and appending white line to frame and rotating the frame - Using a
for loopto 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))
c.rotate()function is being called continuously and thatsl.valueis being updated.