5hyuk1n Posted July 10, 2020 Share Posted July 10, 2020 Hi guys! I'm fairly new to Houdini and would love for someone to point me in the right direction. I'm copying objects on a quadtree plane and want to adjust the size of the instances in order to fit into each primitive. Unfortunately, I can't get the pscale value of the plane, since I'm loosing that in order to copy the objects to the center of the primitive. I hope that makes sense and would really appreciate any tips. Thanks, Misha recursive_subd_001.hiplc 1 Quote Link to comment Share on other sites More sharing options...
Atom Posted July 10, 2020 Share Posted July 10, 2020 (edited) Here is a basic setup. It uses a second loop to give each primitive a unique name. Inside the loop, the area for each primitive is stored as an attribute. After the loop, pscale is derived from the area. Use the ramp and the multiplier to dial in the sizes. ap_recursive_subd_001.hiplc Edited July 10, 2020 by Atom 4 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted July 10, 2020 Share Posted July 10, 2020 To fill quadratic polygons with copies just take the square root of the intrinsic primitive area as point scale: int pt_add = addpoint(0, v@P); float area = primintrinsic(0, 'measuredarea', i@primnum); float scale = sqrt(area); setpointattrib(0, 'pscale', pt_add, scale, 'set'); removeprim(0, i@primnum, 1); KM_recursive_subd_001.hipnc 5 Quote Link to comment Share on other sites More sharing options...
5hyuk1n Posted July 13, 2020 Author Share Posted July 13, 2020 Thanks so much for the fast reply guys! all works perfectly! Quote Link to comment Share on other sites More sharing options...
crispr_boi Posted August 14 Share Posted August 14 How could I animate the Y-scale of each instance randomly? Quote Link to comment Share on other sites More sharing options...
unoccur Posted August 14 Share Posted August 14 In another pointwrangle: v@scale = {1, 1, 1}; v@scale.y = rand(@ptnum); 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.