Rotating each item on its own individual axis?

Recommended Posts

I have a set of items that I copied over a grid of points. Now in order to rotate each of the item on its own individual axis, I used 'For each connected connected piece' but unfortunately, the entire set of geometry rotates on one single axis. How can I do otherwise?

Share on other sites

You would usually define the point orientation before copying objects to them. The normal vector "N" pointing to the front and the up vector "up" pointing upwards, eg. perpendicular to the surface. Next you can rotate the up vector around the normals using a point wrangle.

```float amount = chf('amount');

matrix3 m = ident();
rotate(m, amount * M_PI, v@N);

v@up *= m;```

There are many other ways and as per usual Matt's CG wiki has a good read on this: https://www.tokeru.com/cgwiki/index.php?title=JoyOfVex17

rotate_up.hipnc

Share on other sites

Thanks a ton. VEX is something that I have learnt the very beginning of (from VEX isn't scary series by NineBetween) and I have to spend more hours in learning and understanding it, and only then your point wrangle will make sense to me.

Isn't this type of rotation possible by adding some references in the pivot transform or pivot rotate option in the transform node?

Share on other sites

Handling per object-rotations gets easier after packing and instancing the copies. Eg. the primitive node can do random rotations afterwards.

Edited by konstantin magnus
Share on other sites

@archz2 create att rot than wrangle

`p@orient = eulertoquaternion(radians(v@rot), XFORM_XYZ);`

Share on other sites

On 8/18/2022 at 10:39 PM, konstantin magnus said:

Handling per object-rotations gets easier after packing and instancing the copies. Eg. the primitive node can do random rotations afterwards.

Thanks a lot. That did it. Learnt new things now. 'Primitive properties' node and 'Packing and instancing'. Pasting this for myself. This is quite nice. It references the geometries at every location instead of making copies in order to keep the file performance optimized!

Share on other sites

16 hours ago, Librarian said:

@archz2 create att rot than wrangle

```

Where exactly do I have to paste this code? What is 'att rot' ?

Share on other sites

maybe useful @archz2

Share on other sites

There's a couple good short videos on instance attributes in the documentation for the copy to points sop

Share on other sites

On 8/21/2022 at 6:16 PM, madebygeoff said:

There's a couple good short videos on instance attributes in the documentation for the copy to points sop

On 8/21/2022 at 2:00 PM, Librarian said:

maybe useful @archz2

Thank you @Librarian, I'm putting this in my VEX notes to refer later. I didn't quite understand your code magic :). I know very tiny bit of VEX and will be able to understand your file once I learn more of it.

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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×
×