rb3652
rb3652

Reputation: 445

Rotation Slider in Python Fails

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:

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))

Upvotes: 0

Views: 136

Answers (1)

user1114907
user1114907

Reputation: 992

It looks like the problem is that the rotate function expects angles in radians, not degrees, so you would say angle=radians(sl.value).

Upvotes: 1

Related Questions