A place to talk about CG particles...
login.php?sid=5d1041ecfab004f4fe20050616fcc258 profile.php?mode=register&sid=5d1041ecfab004f4fe20050616fcc258 faq.php?sid=5d1041ecfab004f4fe20050616fcc258 memberlist.php?sid=5d1041ecfab004f4fe20050616fcc258 search.php?sid=5d1041ecfab004f4fe20050616fcc258 index.php?sid=5d1041ecfab004f4fe20050616fcc258

Orbaz Technologies Forum Index » Particle Flow Tools: Box#3 » Getting the first time a condition becomes true.
Post new topic  Reply to topic View previous topic :: View next topic 
Getting the first time a condition becomes true.
PostPosted: Sat May 21, 2011 7:36 am Reply with quote
Q'ba
Joined: 08 Nov 2010
Posts: 16




I have particles continuosly checking their distance to the closest helper in a group. What I'd like to get/store is the absolute time the first time a condition related to that distance becomes true. For example, if the distance checked for is A - store the absolute time of the first occurence of the actual distance being A - if the helpers move out of range and move back later, still keep that initial value. The limitation is that the particles have to stay in one event to satisfy some other requirements of the flow.

Any help would be appreciated. Thank you.
View user's profile Send private message
PostPosted: Sat May 21, 2011 8:07 am Reply with quote
Oleg
Site Admin
Joined: 26 Sep 2004
Posts: 5706
Location: The Hundredth Town, USA




Please keep in mind that the time precision is the integration step - it cannot be more precise than that.

I think you need to create an addition Boolean data channel. By default it is initialized to False. The channel would keep the info whether another channel (Time) is initialized with the right data (the first time the helper is in the range). So, on each evaluation you need to check whether the boolean is false AND a particle withing the distance range. If so, then you record the current time as a time of the first occurrence, and change the boolean from false to true (initialized).

Thanks,
Oleg B.

_________________
The Particles Caregiver
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Mon May 23, 2011 1:42 pm Reply with quote
Q'ba
Joined: 08 Nov 2010
Posts: 16




Thank you for the reply.
I believe I understand the logic, but the wiring eludes me. I've tried to set up a basic test data flow, but I'm not getting the correct results. In this case, I'd like Time Absolute to send out the absolute time value of first time the Test Condition is satisfied and before that, 0. As you may infer, it's not working.
Again, any help would be appreciated.



ConditionTrueTime.JPG
 Description:
 Filesize:  13.92 KB
 Viewed:  4326 Time(s)

ConditionTrueTime.JPG


View user's profile Send private message
PostPosted: Tue Feb 11, 2014 8:38 am Reply with quote
henning
Joined: 14 Feb 2012
Posts: 4
Location: Mainz, Germany




Ok it's a bit late, but have you solved this Q'ba?
View user's profile Send private message
PostPosted: Sat Feb 22, 2014 7:31 pm Reply with quote
nickolay411
Joined: 12 Jan 2009
Posts: 296
Location: LA




Howdy,

I would approach it another way. Lets say, on New in Event you have a output new data channel piping in an integer of 0. Call this IntContainer Now whenever the ref point gets within lets say 40 units of the particle. You input the custom data channel IntContainer and add an integer of 1. Then you pipe that result into outputcustom output selecting IntContainer.

Create a condition if IntContainer = 1 then Output your Time Absolute.

Thats it!

Cheers,
Nick



test_time_closest.mov
 Description:

Download
 Filename:  test_time_closest.mov
 Filesize:  1011.1 KB
 Downloaded:  235 Time(s)

View user's profile Send private message AIM Address
Getting the first time a condition becomes true.
Orbaz Technologies Forum Index » Particle Flow Tools: Box#3
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic  


Copyrightę 2004-2005 Orbaz Technologies, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group
phpBB Style by Vjacheslav Trushkin