Thread: random rotate expression View Single Post
# 1 08-10-2012 , 04:07 PM

Subscriber
Join Date: Oct 2005
Posts: 1

#### random rotate expression

Hi all, I have been ripping my hair out trying to get this correct. What I have is an airplane that is instanced to particles and moved in formation with an air field. Simple enough, but what I need now is to randomly rotate them like if they are individually rocking back and forth (twists where wngs go up and down).
Have a creation expression of: particleShape1.RandRotate = <<0,0,rand(-3,3)>>; because I want the planes to be created with a rotation, randomly, between -3 and 3. Again simple enough, but now where the problem comes in, I need them to twist smoothly and randomly between -3 and 3 during runtime.
Have a runtime expression of: particleShape1.RandRotate += <<0,0,sin(time*2)*1.1>>; which works, but it does not sweep between the full positive and negative degrees. Would not make any sense to have them only rotate between 0 and 3 say haha.
Anyone have any ideas?