Point position attribute name when more than 1 point

Hi all! I’m new to Touchdesigner and even newer to POPs, so excuse me if this question has an obvious answer.

When I use the Point POP to create more than one point, say two, how can I refer to the position attribute of each point? I want to calculate the distance between point 1 and point 2 with a vector output, and use it to calculate something else, so I thought I’d do it in MathMix. I cannot find a way to refer to the P attribute of point 1 and 2 separately.

Any suggestion would be appreciated. Thanks so much in advance!

Hi @kimhong2702,

to calculate the distance between 2 points in a POP, you could use the Neighbor or Proximity POP enabling their distance attributes. (Check the OPSnippets to see how they work)

The thing to maybe understand is that POPs are acting on the complete set of attributes: instead of point a and point b, you operate on all points at once - perhaps a analogy would be looking at how shaders work with input data.

All the best
Markus

Also in your case you can make a line strip with point 1 followed by point 2, and then use a Line Metrics POP to get the distance or direction to the “next" point in an attribute.

Neighbor POP set “by Connected” may be of use.

In general Math Mix or Math Combine cannot access attributes of other points. indexing other points will come in a future POP. You can now in GLSL POPs.