forcing per object

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
jamination
Posts: 174
Joined: 10 Jul 2009, 21:58

forcing per object

Post by jamination » 17 Oct 2013, 05:53

I am sure there is a rather simple solution to this however i am stuck. I have a pacman type simulation where I have a bunch of dots on the screen, if a dot is in a volume I scale it to zero, when this happens I would like a global counter to go up by one, I created my counter variable in the modeling stack and it is per object, however when I do my volume check and increase the size of my counter it becomes per point. any help would be appreciated.
Phil Harbath
Jamination Productions

User avatar
dwigfor
Posts: 395
Joined: 17 Nov 2009, 17:46

Re: forcing per object

Post by dwigfor » 17 Oct 2013, 07:31

maybe Point ID -> Find in Array (with array plugged in array port)?

flyby
Posts: 13
Joined: 30 Sep 2013, 19:07

Re: forcing per object

Post by flyby » 17 Oct 2013, 14:23

You cannot increase a per object variable from a per point context: imagine all your points are being processed simultaneously. All the points would try to write on that single per object variable... unpredictable results....

So instead you must use one of the Nodes that collect data. Examples are: "Build Array from Set", "Get Set Sum", "Get Set Avg". These nodes wait untill all your points have been processed (while collecting the data), and then give you the result afterwards.

Short example how to use them is below. That code will recompute each frame, how many dots have been "eaten". Not exactly what you asked for, but I'll let you figure out the rest for yourself ;)
Attachments
example.png

jamination
Posts: 174
Joined: 10 Jul 2009, 21:58

Re: forcing per object

Post by jamination » 17 Oct 2013, 20:28

thank you flyby that worked awesome.
Phil Harbath
Jamination Productions

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests