archz2 Posted August 15, 2022 Share Posted August 15, 2022 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? PIVOT ROTATE QUESTION.hip Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted August 15, 2022 Share Posted August 15, 2022 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 2 Quote Link to comment Share on other sites More sharing options...
archz2 Posted August 16, 2022 Author Share Posted August 16, 2022 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? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted August 18, 2022 Share Posted August 18, 2022 (edited) Handling per object-rotations gets easier after packing and instancing the copies. Eg. the primitive node can do random rotations afterwards. copies_rotate.hipnc Edited August 18, 2022 by konstantin magnus 1 Quote Link to comment Share on other sites More sharing options...
Librarian Posted August 20, 2022 Share Posted August 20, 2022 @archz2 create att rot than wrangle p@orient = eulertoquaternion(radians(v@rot), XFORM_XYZ); 1 Quote Link to comment Share on other sites More sharing options...
archz2 Posted August 21, 2022 Author Share Posted August 21, 2022 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 Quote Link to comment Share on other sites More sharing options...
archz2 Posted August 21, 2022 Author Share Posted August 21, 2022 16 hours ago, Librarian said: @archz2 create att rot than wrangle p@orient = eulertoquaternion(radians(v@rot), XFORM_XYZ); Where exactly do I have to paste this code? What is 'att rot' ? Quote Link to comment Share on other sites More sharing options...
Librarian Posted August 21, 2022 Share Posted August 21, 2022 maybe useful @archz2 1 Quote Link to comment Share on other sites More sharing options...
madebygeoff Posted August 21, 2022 Share Posted August 21, 2022 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 1 Quote Link to comment Share on other sites More sharing options...
archz2 Posted August 22, 2022 Author Share Posted August 22, 2022 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 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. 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.