dxhhx Posted July 7, 2016 Share Posted July 7, 2016 Hey guys, Hopefully this is a quick one. I was wondering how I could find the average position of a group of particles (and store the position as an attribute on the particles in that group)? Say I have two groups, A and B, and I want to find the average position of the particles in group A and create a force on the particles in group B to go towards that point (center of A), and at the same time have all the particles in group A move towards center of B. POP Group A -> Center of POP Group B POP Group B -> Center of POP Group A Thanks Quote Link to comment Share on other sites More sharing options...
dchow1992 Posted July 7, 2016 Share Posted July 7, 2016 there's probably a much simpler way to do it pop_avg_p_001.hip Quote Link to comment Share on other sites More sharing options...
dxhhx Posted July 7, 2016 Author Share Posted July 7, 2016 (edited) Hey thanks for the file David! Haven't even crossed my mind to bring it into a SOP Solver. Would have liked to have access to the average position attribute for use with the POP Solver, but this will work for what I need. Btw I tried to see if I can replace your "detail_avg_pos" wrangle with two attribpromote, but it doesn't seem to work. Do you have any idea why? Thanks again, much appreciated pop_avg_p_002.hip Edited July 7, 2016 by dxhhx Quote Link to comment Share on other sites More sharing options...
dchow1992 Posted July 7, 2016 Share Posted July 7, 2016 (edited) it's not working because when you are blasting the groups, the points still have both detail attributes on them from the previous frame but each blast only computes one. Since we are working with detail attributes and can only have one value per attribute, the values from the left input of the merge are taking priority. I don't see why you can't use these attributes with other pop solver nodes, you can access it as a detail attribute or promote it to the point level every frame if that's easier. Edited July 7, 2016 by dchow1992 1 Quote Link to comment Share on other sites More sharing options...
dxhhx Posted July 7, 2016 Author Share Posted July 7, 2016 Got it. Gonna use this now, thanks a lot dude! 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.