Jump to content

Transfer primitive attribute to generated centroid point?


fiverob

Recommended Posts

Hey everyone,

So, I'm attempting to recreate this packed objects / dart throwing technique from Simon Holmedal. 

I feel I'm close, but I'm struggling with a n00b problem and was hoping someone could take a look and help me out.

I have an attribute on the primitives that I want to drive the scale of the copied spheres. I've done an attribute wrangle on the primitives to create new points at the center of each which I plan to use as the locations for the copied spheres. I just can't seem to work out how to transfer the attribute AND delete the primitives. I'm not having any luck with the attribute transfer node.

Any ideas?

Thanks legends. 

 

DartThrowingAttempt.hip

11349231_1011403352225752_201226726_n.jpg

Link to comment
Share on other sites

you can use setattrib to set point attributes

ex:

int newpt = addpoint(0, @P);
setattrib(0, "point", "pscale", newpt, 0, @area);
removeprim(0, @primnum, 1);

make sure you have pscale on your points

edit*couldn't resist trying to make something

kinda slow though, i'm sure there's a better way

 

sphere_pack.jpg

sphere_packing_005.hip

Edited by dchow1992
  • Like 1
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...