Jump to content

Rotating each item on its own individual axis?


archz2

Recommended Posts

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

  • Like 2
Link to comment
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? 

image.thumb.png.66bf013f5a84621847362475235b8ceb.png

Link to comment
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.

copies_rotate.hipnc

 

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!

https://www.sidefx.com/docs/houdini/copy/packed_and_soups.html

Link to comment
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

https://www.sidefx.com/docs/houdini/nodes/sop/copytopoints

Superb! Thanks a lot @madebygeoff! These are immensely helpful!

 

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

maybe useful @archz2

 

bnv.jpg

 

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. 

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...