samboosa Posted January 31, 2013 Share Posted January 31, 2013 Hello all! I have a grid of boxes which I want to rotate randomly but I want to limit to rotations to say 15 degrees and -15 degrees. I know I could clamp the rotation between 345 degrees and 15 but this would be too erratic, what I want is for these boxes to jiggle basically. This seems very simple but I just can't think of it, any ideas? - Samboosa. Quote Link to comment Share on other sites More sharing options...
acey195 Posted January 31, 2013 Share Posted January 31, 2013 you can write a simple expression for this: (-15+(rand($PT)*30)), something like this would do the trick if you want to rotate over more axes: (-15+(rand($PT+874)*30)) (-15+(rand($PT+411)*30)) just add different generic numbers for each axis if you do this via copy stamping: (-15+(rand(stamp("../copy1","copy",0)+411)*30)) 1 Quote Link to comment Share on other sites More sharing options...
samboosa Posted January 31, 2013 Author Share Posted January 31, 2013 I can't believe I didn't think of that! I honestly don't know why I didn't think of setting the rotation to the minimum value at first, this will come in handy! Quote Link to comment Share on other sites More sharing options...
anim Posted January 31, 2013 Share Posted January 31, 2013 for readibility it makes more sense to use fit01() expression like fit01(rand($PT), -15,15) or 15*fit01(rand($PT), -1,1) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.