Anyone here used closestPointOnMesh to get UV parameters?
If I create a polyPlane and attach it to a CPOM node (either manually or using Constrain > Closest Point), as I change the inputPosition the result position updates correctly, but the UV values only change when I cross into a new polygon. So with a 10x10 plane, the only U values I ever get are .1, .2, .3, etc. The closest vertex index is similarly wonky, only changing when I cross an edge (so no matter where my position is, I will only ever get one closestVertex for each closestFace).
i ran into similar issues with closest point on mesh. Here is what you need to do.
you need to connect the worldMesh of the target mesh to the inMesh of the CPOM node.
then you need to connect the worldMatrix of the target to the inputMatrix of the CPOM node.
Basically, the CPOM, by default, is working in Object space, so you need to do some wiring under the hood to get proper world space measurements.
With those connections, I only seem to get accurate measurements when transforms are frozen. If I create a plane and move it, then setup a CPOM, I will get stepped UV values. Once I freeze transforms the values are accurate. Am I doing something wrong? Know how I can get accurate measurements with a transformed piece of geo?
Hmm, yeah, face works fine for me, as does position. Vtx and UV were the wonky ones.
I can get the results using the API, but it just takes a while to run when I’m sampling 10,000 points on a 250,000 poly mesh. I was thinking that using the CPOM node would be faster. In the end it’s not essential, but I was just curious if it was something I was doing wrong, or if the node has short comings.