Jump to content

Recommended Posts

I want to copy objects on points and randomize them in rotation (e.g. Y axis)  from 0° to 360° but in 90° steps. I think I need kind of an expression like " (round(rand($PT))*90)" but this gives me only 0° or 90°. I do not quite come up with the right solution for 360°. Would be nice to get some help with that.

kind regards

Jon

rotateIn90degreeSteps.hipnc

Share this post


Link to post
Share on other sites

(round(rand($PT)*4)*90)

 

?? :)

Edited by davpe
  • Like 1

Share this post


Link to post
Share on other sites

hm...I think rand($PT) gives me 0 or 1 and that *4*90 will give me 0° or 360°  but nothing between ?!  ;)

 

OH sorry davpe!!! you are right! Its works :) I was to fast sorry. Thank you!

Edited by jon3de

Share this post


Link to post
Share on other sites

hehe :) sure, it happens to me all the time :) 

Share this post


Link to post
Share on other sites

Would there be a simple way of doing this while using a copytopoints node rather than a copystamp? New here, thanks!

Share this post


Link to post
Share on other sites

in a point wrangle:

 

vector axis = set(0,1,0); 

float angle = rint(fit01(rand(@ptnum), 0,4)) * 90;

p@orient = quaternion(radians(angle), axis);

 

this creates an axis/angle rotation and sets it to the p@orient attribute, which copy to points reads natively.

you could also try MOPs Randomize, it has a Step parameter that can lock to specific degrees.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×