It is currently 22 May 2013, 20:35

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Multiple Goals - Randomly Selecting Particles
PostPosted: 11 Jun 2009, 12:56 
Offline

Joined: 09 Jun 2009, 21:08
Posts: 11
Hi All,

I'm working on a project with a set of 50 balls (particles) and a grid of about 16 goals. I wonder if anyone can help me figure out a way to randomly choose 16 of those 50 particles and tell them to move to their nearest goal (with no conflicts). I'm using RBD as the balls need to collide with each other and a drum surrounding it, kinda like a lottery ball system. Then I need to blow the balls up with a wind force and the random choosing(of the 50) starts again. Attached is the ICE tree I have at the moment. I've got 3 states. 0 being the initialised state, 1 being activated when close enough to a goal to activate the "move to goal" compound and the 3 is just to tell me that it's at the goal (another proximity test but much closer).

The problem I'm having is at the moment I'm relying proximity of the Particles to the goal to get me a selection, which means I may get more than one particle going to the same goal so they don't sit in a nice tidy grid. Also the particles don't go to the centre of the goal just the closest part of its geometry, I thought I might be able to provide a 3D vector array of all the global centres of the Goal cubes into the Set Particle Goal node, but it doesn't accept that data type. So I'm just using a group with the geometry option instead which isn't ideal. Can anyone think of another approach to this, or a tweak to what I'm doing now?

Thanks so much

Burgy


Attachments:
GoalsICE.png
GoalsICE.png [ 185.46 KiB | Viewed 730 times ]
Top
 Profile  
 
 Post subject: Re: Multiple Goals - Randomly Selecting Particles
PostPosted: 13 Jun 2009, 21:12 
Offline
User avatar

Joined: 09 Jun 2009, 11:59
Posts: 555
Location: warsaw
Is this what you are looking for ?
Ive attached a scene, It RBD+ 3 goal and 3 specific particles move towards each specific goal


Attachments:
move towards goal_wybrane particle.rar [183.72 KiB]
Downloaded 45 times
particle_to_goal.jpg
particle_to_goal.jpg [ 166.89 KiB | Viewed 673 times ]

_________________
http://vimeo.com/origin/videos
Top
 Profile  
 
 Post subject: Re: Multiple Goals - Randomly Selecting Particles
PostPosted: 14 Jun 2009, 10:55 
Offline

Joined: 09 Jun 2009, 21:08
Posts: 11
You Sir are a genius!

Thank you so much.

Can you tell me how this is working? You've altered the move towards goal compound right? What have you done?

Thanks again!


Top
 Profile  
 
 Post subject: Re: Multiple Goals - Randomly Selecting Particles
PostPosted: 14 Jun 2009, 11:10 
Offline
User avatar

Joined: 09 Jun 2009, 11:59
Posts: 555
Location: warsaw
hey see attached scene,
I just took Move Towards Goal Location compound from Move Towards Goal compound (because MTG sets a goal everytime)

Basically everything is on the screenshot - one particle is FILTERED OUT and is given a new goal position and a custom variable this_particle_is_moving=true.

And In main tree only particles with this custom variable are moved with MTGL compound.

Im not ICE guru so this could be probably done better

_________________
http://vimeo.com/origin/videos


Top
 Profile  
 
 Post subject: Re: Multiple Goals - Randomly Selecting Particles
PostPosted: 14 Jun 2009, 13:38 
Offline

Joined: 09 Jun 2009, 21:08
Posts: 11
Brilliant! So would there be a way of randomly picking which particles get this variable and change this to other particles at different times? Could this be done via states?


Top
 Profile  
 
 Post subject: Re: Multiple Goals - Randomly Selecting Particles
PostPosted: 15 Jun 2009, 12:58 
Offline

Joined: 09 Jun 2009, 21:08
Posts: 11
OK have had a look at this scene and I think i'm getting this now. I'm having a slight problem with you scene tat i can't seem to work out. If I disconnect two of the three of your custom move_selected_particle compounds but still am having three particles moving towards the one goal. What I can't work out is why is it 3 particles rather than one particle that is moving towards the goal?


Thanks

Bry


Top
 Profile  
 
 Post subject: Re: Multiple Goals - Randomly Selecting Particles
PostPosted: 29 Jun 2009, 18:57 
Offline

Joined: 29 Jun 2009, 18:50
Posts: 3
burg wrote:
Brilliant! So would there be a way of randomly picking which particles get this variable and change this to other particles at different times? Could this be done via states?


You could add a custom parameter (self.whatever) and then assign a randomly selected Boolean (0 or 1) to that parameter. Then test for 1 before processing anything that you want to be processed for these particles.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group