Page 1 of 1
Constrain movement of an object within a defined area?
Posted: Thu Jun 02, 2016 7:12 pm
by Ahroo
I have a plain, simple box. Inside it (on a separate layer) is a ball. I want the ball to be able to move about anywhere within the box, but not be able to "escape" the box. Think pinball machine, except that I don't need to automatically control the movement in any way (e.g. bouncing off the sides) - just the limits of where the ball can go. I will manually animate the ball, but thought it might make it easier if it could be set up so that the ball cannot move outside the box so I don't have to be as careful in the animation process (ultimately there will be multiple balls, controlled by one or more bones, so this could be a time saver in the long run if I can get it to work). Obviously, I cannot use masking because it will allow the ball to move beyond the perimeter of the box, just not show the part that is outside. I thought that perhaps there is some way I can utilize physics to accomplish this, but so far I have not been able to figure it out or find any previous topics on the forum about this. Any suggestions (using physics or any other solution) to restrict the movement of the ball to within the confines of the box?
Thanks!
Re: Constrain movement of an object within a defined area?
Posted: Fri Jun 03, 2016 9:56 am
by slowtiger
What about binding that ball to a very long bone with small angle constraints which is the perpendicular child of another very long bone also with small angle constraints? It will not be a perfect rectangle, but good enough.
Re: Constrain movement of an object within a defined area?
Posted: Sun Jun 05, 2016 7:25 pm
by Ahroo
Thanks for your reply, Slowtiger. I did think about using bone constraints (and have been playing around with this a bit, experimenting with various constraint and bone length settings), and it does help some. Now I'm trying a ball inside a circle, and the double, constrained bone technique works to some degree, but there are still areas where the ball either extends beyond the outer circle, or never quite makes it to the edge. I just don't know if animating the bones in this manner works any easier/better/faster than just manually moving the ball, so I'm still looking for another option to restrict where the ball can go, if anyone has any ideas.
Re: Constrain movement of an object within a defined area?
Posted: Sun Jun 05, 2016 8:20 pm
by synthsin75
Re: Constrain movement of an object within a defined area?
Posted: Mon Jun 06, 2016 12:17 am
by Ahroo
Thanks, Wes - that's amazing and exactly what I was trying to accomplish! I don't yet understand HOW it works, but I will be studying your file (it obviously has something to do with the angle control bone, which I've never used before, and the IK stretching, so I'll need to do some research and experimenting with those). I appreciate you taking the time to work on this!
Laura
Re: Constrain movement of an object within a defined area?
Posted: Mon Jun 06, 2016 12:32 am
by synthsin75
Ahroo wrote:Thanks, Wes - that's amazing and exactly what I was trying to accomplish! I don't yet understand HOW it works, but I will be studying your file (it obviously has something to do with the angle control bone, which I've never used before, and the IK stretching, so I'll need to do some research and experimenting with those). I appreciate you taking the time to work on this!
Laura
The angle control just keeps the point-bound ball from rotating as its parent bone follows the target bone. The big bone (B1) has 100 maximum IK stretching and is scaled to 0.01 on frame one. This is what allows it to shrink as the target gets closer. It's the trick Victor used here:
viewtopic.php?p=149734#p149734
Re: Constrain movement of an object within a defined area?
Posted: Mon Jun 06, 2016 5:28 pm
by Ahroo
Still a bit baffled, but I'm working with it and will eventually figure it out. Thanks again!!