kidsreturnjj Posted October 26, 2012 Share Posted October 26, 2012 I used RBD point and do simulation with many spheres. I hope to get center point about simulated spheres. Could you guys help me? Quote Link to comment Share on other sites More sharing options...
Rudinie Posted October 26, 2012 Share Posted October 26, 2012 Have a look at the centroid expression. Quote Link to comment Share on other sites More sharing options...
old school Posted October 26, 2012 Share Posted October 26, 2012 That would be the centroid of the simulation objects. Didn't mention where you wanted to get the centroids. Inside DOPs, each simulation object has a pivot point (p) defined from the origin along with the current position (t) in the Position sub-data. Just add the two gives you the pivot point world location. You can access this with the dopoption() or dopoptions() expression. For example in any DOP parameter processing the RBD objects, you could fetch "p" by: dopoption("/obj/AutoDopNetwork", $OBJ, "Position", "py")0.5299[/CODE]or[CODE]dopoptions("/obj/AutoDopNetwork", $OBJ, "Position", "p")[0, 0.5299, 0][/CODE]Just do the same for t and add the two together.Another way is to use the Dynamics CHOP and fetch p and t there and add the two together with a Math CHOP.Fetching RBD simulation objects (bullet or RBD) with the DOP Import SOP, you have several options of which one is "Create Points to Represent Objects" which is that actual pivot "p" plus position "t" along with a bunch of other attributes to set you up for low-high res geo substitution and instance rendering. You can copy/paste the existing DOP Import SOP and have one to fetch the geometry and the second to fetch the points. They will both have the same order to them making indexing the two straightforward.If you are loading in geometry blind and don't have any of the DOP data available, then you have to build your own centroids by using a ForEach SOP and loop over every group (pre-processed with a Connectivity and Partition SOP combo to create the groups) and yes use an Add SOP with the centroid() expression mentioned above pointing to the Each SOP inside.There should be examples of all in various forums for the above methods. 1 Quote Link to comment Share on other sites More sharing options...
woodenduck Posted October 26, 2012 Share Posted October 26, 2012 (edited) Here's an example of the add sop/foreach method. sim_centre.hip Edited October 26, 2012 by woodenduck Quote Link to comment Share on other sites More sharing options...
galagast Posted September 22, 2013 Share Posted September 22, 2013 Fetching RBD simulation objects (bullet or RBD) with the DOP Import SOP, you have several options of which one is "Create Points to Represent Objects"... Thanks! This was exactly what I was looking for! I was initially going for the For Loop method, but it was taking too long to do it over thousands of bullet objects. 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.