atron Posted July 22, 2017 Share Posted July 22, 2017 Hi there, i'm trying to animate multiple points that move randomly within a boundary. So far i have the random movement done, but i want to be able to get the points to collide with the boundary and carry on moving. Any help would be great. A walker.hipnc Quote Link to comment Share on other sites More sharing options...
f1480187 Posted July 23, 2017 Share Posted July 23, 2017 Try Even–odd_rule. You can check if a next step will bring the point outside of the polygon, and change direction to prevent it. Also, there is Vector2 class in HOM. I would subclass it and define my own methods in case I need extra functionality. Quote Link to comment Share on other sites More sharing options...
atron Posted July 23, 2017 Author Share Posted July 23, 2017 thanks F1, that worked awesomely with the Even-odd rule. I first used a grid sop but then it wasn't working properly so ended up drawing the bounds with a curve sop and it worked. Quote Link to comment Share on other sites More sharing options...
atron Posted July 24, 2017 Author Share Posted July 24, 2017 Hi there, I'm trying to flip the vector once it reaches the boundary of the square and then it carries on moving randomly within the boundary, but i can't seem to get it to do this. A boundaryavoider.hipnc 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.