Jump to content

rotate in 90° steps


jon3de

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

Link to comment
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
Link to comment
Share on other sites

  • 5 years later...

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.

 

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...