DOP Question.

   2855   9   0
User Avatar
Member
197 posts
Joined: 6月 2012
Offline
Ok this has been bugging me for weeks, how can I have a gravity dop trigger when the objects are inside a ball? I know it's possible, but need help!!
User Avatar
Member
390 posts
Joined: 1月 2012
Offline
Hope this helps. Ask if you have any questions.

Attachments:
gravitybysphere.hipnc (160.1 KB)

.
User Avatar
Member
197 posts
Joined: 6月 2012
Offline
Can you explain whats going on?
User Avatar
Member
390 posts
Joined: 1月 2012
Offline
First we create a bunch of boxes by copying boxes to points made by a pointsfromvolume sop. Then we use a connectivity and a partition to group them by box, box_0, box_1.. Then in the dopnet we make those rbd obejcts through an rbd fractured object dop. The boxes move because of an initial velocity set in this dop.

While simulating those boxes, we bring them back into geo1 through the dopimport sop. Then, in foreach1, we add centroids to each box. Then we create an attribute ‘insphere’ with a value of 0 on each of these centroids. Then we group these centroids in group1 if they are in the sphere or not. We then take the ones that are in that group and change that ‘insphere’ attribute from 0 to 1.

Back in the dopnet we use a group dop to group objects based on a point expression,

point(“/obj/geo1/POINTS”, $OBJID - 2, “insphere”, 0)

which looks at those points, for the attribute ‘insphere’. For the point number, we use $OBJID - 2, because there are 2 other objects in the dopnet that get made before our boxes, groundplane1 and box - the empty object that is created by the rbd fractured object. So this expression takes the current dop object, lets say box_0, and then looks into geo1, for point 0 of POINTS, and grabs its ‘insphere’ attribute. If its a 0, it doesnt go into the group, if its a 1 it does. The gravity dop then only affects the dop objects that are in that group.

This is not the most efficient way to do this, but I left it simple so that you could get a good idea of whats going on.
.
User Avatar
Member
197 posts
Joined: 6月 2012
Offline
Thanks make's perfect sense, eventually I'll be up-scaling this to a whole lot of objects (10,000 +), so I'll start working on a better way. Any helps always appreciated thanks!
User Avatar
Member
197 posts
Joined: 6月 2012
Offline
It makes sense but is not working when I remake it, if you wouldn't mind looking at my hip.

Attachments:
Activate by sphere problem.hipnc (350.9 KB)

User Avatar
Member
390 posts
Joined: 1月 2012
Offline
So the problem you had, was that your centroids and dopobjects were not created in the same order. Ive changed it so it will work now.

Attachments:
activate_by_sphere_problem_896_FIXED.hipnc (365.9 KB)

.
User Avatar
Member
197 posts
Joined: 6月 2012
Offline
OK, I've got it down now, is this going to be extremely slow when a lot of objects come in to play? And should I try a more complicated version?
User Avatar
Member
606 posts
Joined: 5月 2007
Offline
How about just having a spherical mask field for the force dop, or am I misunderstanding the scenario?

EDIT: oops, yeah, using a mask field the gravity will stop affecting when the objects leave the sphere, which is probably not wanted.
User Avatar
Member
390 posts
Joined: 1月 2012
Offline
Well, I believe the same is also true for this method. If you do the triggers in a solver sop or trail the points that should solve it though.
.
  • Quick Links