What's the difference between $PT and $ID

   15612   5   1
User Avatar
Member
57 posts
Joined: Feb. 2006
Offline
Hi, everyone.
My simple question:
What's the difference between $PT and $ID?

One is point number and another is ID number.
They're useful in using particles.
I put it in this way to say, A Point has PT and ID, doesn't it? :roll:

Thanks for your reading.
User Avatar
Member
186 posts
Joined: Jan. 2006
Offline
in POPs, particles have both $PT and $ID. the main difference is that when particles die, the $PT of the remaining particles mostly will change ($PT always goes from “0” to “amount_of_points - 1”), whereas $ID remains constant. a good way to remember this is that $ID is a point attribute, whereas $PT is just the index of the point in the group of all points.


so if you have expressions that rely on some point numbering to achieve an effect (like say rand($PT) for a random number based on the point number), you should use the id of the particle instead, since that is guaranteed to stay the same (so you'd use rand($ID)).

sorry for the complicated way of explaining cheers
User Avatar
Member
57 posts
Joined: Feb. 2006
Offline
Your explanation is clear and great!!
You mention $PT is changed by the amount of points.
I think this is the key to differentiate between them.

Thank you and your reply.

Happy
User Avatar
Member
6 posts
Joined: Nov. 2016
Offline
Thanks for the explanation anamous!
User Avatar
Member
6 posts
Joined: Aug. 2018
Offline
Would you please more elaborate it in the easiest way? that's really complicated explanation
User Avatar
Member
80 posts
Joined: June 2013
Offline
The particle $ID is unique to each particle, even if it dies. The $PT number (or @ptnum) is not. So if you need to tie an action to a specific particle or point regardless of how the points come and go, the @id or $ID is guaranteed to work.
Edited by Rebus B - Sept. 11, 2018 11:33:54
  • Quick Links