Hello;
I copied several geometries on a grid, using “Copy to Points” SOP and “For each loop”…
All copies have same Transforms, so how can I rotate each piece randomly?
(I attached my scene here)
Thanks.
How could I rotate "Copied to Points" geos randomly...?
54063 12 5- Masoud
- Member
- 414 posts
- Joined: 8月 2015
- Offline
- Werner Ziemerink
- Member
- 1268 posts
- Joined: 3月 2014
- Offline
- Masoud
- Member
- 414 posts
- Joined: 8月 2015
- Offline
- Mohanpugaz
- Member
- 146 posts
- Joined: 6月 2016
- Offline
put a pointwrangle node above your foreach loop and
type this to get what you want
copy to points will rotate the copied geos based on certain attributes present in the template points such as N v and orient. I would suggest the best to use is orient, But N is simple it will align the z axis of your source geo to the normal of the template points
Read the below page to know how houdini aligns the instanced objects
http://www.sidefx.com/docs/houdini16.0/copy/instanceattrs [sidefx.com]
you can add attribute randomize to the template points before copy sop like werner says and you should change the dimension to 4 in the attribute randomize sop as orient is a 4float attribute.
type this to get what you want
@orient = rand(@ptnum);
copy to points will rotate the copied geos based on certain attributes present in the template points such as N v and orient. I would suggest the best to use is orient, But N is simple it will align the z axis of your source geo to the normal of the template points
Read the below page to know how houdini aligns the instanced objects
http://www.sidefx.com/docs/houdini16.0/copy/instanceattrs [sidefx.com]
you can add attribute randomize to the template points before copy sop like werner says and you should change the dimension to 4 in the attribute randomize sop as orient is a 4float attribute.
Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
- Simon van de Lagemaat2
- Member
- 116 posts
- Joined: 4月 2016
- Offline
This must be one of the most asked questions I see about Houdini, probably because it's one of the more common workflows. It really is time that we get a node for taking care of the various transforms and their randomization's we tend to do when copying.
edit: actually a masterclass on setting something like this up would be a good intro into the workflow of houdini.
edit: actually a masterclass on setting something like this up would be a good intro into the workflow of houdini.
Edited by Simon van de Lagemaat2 - 2017年5月8日 22:14:51
Simon van de Lagemaat
owner the Embassy VFX
owner the Embassy VFX
- Masoud
- Member
- 414 posts
- Joined: 8月 2015
- Offline
- Nima
- Member
- 471 posts
- Joined: 11月 2013
- Offline
Masoud
Thanks everyone.
Thank you Mohanpugaz,
“PointWrangle ” and “Attribute Randomize” works fine.
I'm wonder why “Attribute Create” with same configurations doesn't works!
Hello dude.
Yes, it shouldn't work because the type of the orient attribute is vector 4 (Quaternion) not just ordinary vector which has 3 components.
Therefore in attribute create node set the type to float and set the size to 4.
Now you should see something…
- paranoidx
- Member
- 34 posts
- Joined: 2月 2018
- Offline
- crashtackle
- Member
- 14 posts
- Joined: 3月 2019
- Offline
- maxpleaner
- Member
- 16 posts
- Joined: 7月 2020
- Online
- soswow
- Member
- 8 posts
- Joined: 8月 2023
- Offline
I just installed Houdini, watched first tutorial lesson, and wanted to add extra rotation to donuts falling down. Came here to find an answer. I've added new attribute randomizer node and didn't know what attribute name to put. Don't know how you folks know those. I am sure there is a way to find out all the available attribute. I expected a dropdown or smth, but it wasn't there. Anyway, this thread helped - it's `orient`, but also it needs 4 values. But! It seems like this property is a quaternion, which means if i want to restrict rotation to some axis I would need to get a PHD to understand how quaternions work.
But! I was playing a bit and found that You can change `distribution` parameter to "Direction or orientation" And there is a `Cone Angle` Slider that kinda does what I wanted (though I still don't know what it does exactly.
Anyway, I thought next person like me might enjoy this discover to make falling dunuts a bit more fun.
But! I was playing a bit and found that You can change `distribution` parameter to "Direction or orientation" And there is a `Cone Angle` Slider that kinda does what I wanted (though I still don't know what it does exactly.
Anyway, I thought next person like me might enjoy this discover to make falling dunuts a bit more fun.
- toadstorm
- Member
- 384 posts
- Joined: 4月 2017
- Offline
If you want to apply rotation around specific axes to existing points (meaning Scatter and Align isn't exactly what you need), you can use MOPs Randomize SOP to do local or world random rotations.
The manual way to do it is with a bit of VEX. First you create a transform matrix or quaternion based on your existing N and up values, then you rotate that matrix or quaternion, then output to p@orient or 3@transform (or @N and @up) depending on your preference.
The manual way to do it is with a bit of VEX. First you create a transform matrix or quaternion based on your existing N and up values, then you rotate that matrix or quaternion, then output to p@orient or 3@transform (or @N and @up) depending on your preference.
vector fwd = v@N; vector up = {0,1,0}; // if you don't have a defined up vector but want to compute one the way houdini does it natively, // compute the rotation that rotates +Z to N and apply this to +Y... // matrix3 d = dihedral({0,0,1}, fwd); // up = normalize(d * up); matrix3 m = maketransform(fwd, up); // now you can rotate this around whatever axis you want. vector axis = normalize(chv("axis")); // or use an existing vector attribute! float angle = radians(ch("angle")); // or use a random float attribute! rotate(m, angle, axis); // now convert this rotated matrix to a quaternion and bind to p@orient. copy to points and/or DOPs will understand this. p@orient = quaternion(m);
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
- Ed B
- Member
- 7 posts
- Joined: 7月 2014
- Offline
that instanced geo link on SideFX is now here: Copying and instancing point attributes [www.sidefx.com]
-
- Quick Links