Rudinie Posted January 17, 2011 Share Posted January 17, 2011 When instancing geometry to points with an instance-sop (so not with a copy-sop) i found on the various forums that you can use point attributes to randomize the instances' scale or rotation. I've found Wolfwood's post that explains how the attributes are interpreted: http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=6679 So i used an attributecreate-sop to add the orient-attribute that i need and made this a Float size 4 with writing values 0,1,0,and rand($PT)*360 to randomize the rotation on the y axis. The orient does not expect a degree value i think because i do not get the randomized y-rotation i was hoping for. Just putting rand($PT) in there does have a better effect but the rotation does not seem random, or at least not from 0-360 degrees. What is it expecting? Radians doesn't seem to be the answer because rad(rand($PT)*360) does not give a good randomization neither. How can i get a good distribution of random rotations between 0 and 360 degrees here? 1 Quote Link to comment Share on other sites More sharing options...
Macha Posted January 17, 2011 Share Posted January 17, 2011 (edited) Try radians in this vopsop. I can't remember what quaternions actually give. They are a bit special, you can even store double rotations in it (2pi). But it's kindly been made palatable for us as a vex, by clever devs. rad.hipnc Edited January 17, 2011 by Macha Quote Link to comment Share on other sites More sharing options...
anim Posted January 18, 2011 Share Posted January 18, 2011 here is a simple example how to randomize orient by randomizing euler angles, look into VOP orient_variance.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Rudinie Posted January 18, 2011 Author Share Posted January 18, 2011 Thanks guys, a voppop did the trick. I combined the two examples to get a version that fully randomizes yrot (0-360 degrees) and varies the orientation as much as you want. On a sidenote, i noticed you can limit the threading in the voppop to none or one per proc, etc. How do i figure out if the voppop can fully use all procs/threads in my pc? orientation_variation_plus_yrot.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted January 18, 2011 Share Posted January 18, 2011 ... On a sidenote, i noticed you can limit the threading in the voppop to none or one per proc, etc. How do i figure out if the voppop can fully use all procs/threads in my pc? one per proc is actually one per core or thread, don't know exactly, but it should use as much as it can Quote Link to comment Share on other sites More sharing options...
Nik S Posted September 17, 2012 Share Posted September 17, 2012 Just a follow up question for Instancing, Has anyone been able to pass the Instancer Point Attributes for for custom AOVs? I have already figured out how to assign random shaders per instance (you have to hijack the shop_materialpath attr) but the thing is the instances are not respecting my custom AOVs... I currently have a POP sim with a number of custom point attributes (with matching parms in the shaders) setup to create custom AOVs. If I use a Copy Sop the AOVs work fine, however when I switch to instancing they don't seem to be recognized. Anyone have any luck with user AOVs and instancing? Thanks!! - N Quote Link to comment Share on other sites More sharing options...
loogas Posted April 13, 2016 Share Posted April 13, 2016 Hi, I appreciate all the examples - they're working fine but with VOPsops. We're supposed to be using Attribute VOPs now and after spending 3 hours on this simple task I just gave up. The randomization is not working. How does one translate the simplest example, from Macha's file, into Attribute VOP? I've attached my attempt and screenshots. Thanks for any help, it's driving me crazy... (I'm still quite new to Houdini). random_rotation.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted April 13, 2016 Share Posted April 13, 2016 (edited) use bind export instead of Add Attribute, that's the most common problem of switching to CVEX, Add Attribute is not meant for the same puropse as in VOP SOP, you can find plenty of threads about that in here where it's explained Edited April 13, 2016 by anim 1 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.