PDA

View Full Version : How to evaluate nearest polygon surface position from null ?



nadiamask
07-19-2012, 04:05 AM
I'd like to make node setting as motion plugin "sticky"
( "sticky" does not gives channel modification cause it's not a node)
but can't find way how to evaluate nearest spot position

Opened motion node editor by mr dpont....
I tried with the node "nearest point" by mr dpont and
lw's channel plug in "approximate" for shortest distance to mesh
.. a bunch of triangle funtions like cos, sin, acos...
finally failed to identify nearest position on the mesh surface.


..
Suppose here exist a null object and a mesh object
I intend to place my null on the nearest polygon surface
I need node setting for this sticky fuction as my character rigging requires

I'm curious how lw's channel plugin "approximate(evaluate distance)" works
if I take the way it works..

and also the way to evaluate the normal vector that the spot have.

Any nice man give me some instruction for node solution ?

adk
07-19-2012, 08:16 PM
I'm not sure that I fully understand what it is you're trying to do nadiamask, but are any of these close to what you have in mind ?

First one is 2 polys (red & green) displaced so that they stick to the terrain (you can't displace a null as far as I know as it's not geometry) ... then you have nulls (black crosses in their middle) that effectively follow those polys nearest point (centre point in this case) using nodal motion. Sometimes the nulls go a bit whacky in terms of position but they always stick to the centre point after an F9.

Second one is simply a null (orange disc) that's moved using nodal motion & nearest point of the mesh underneath. Only it's first, middle & last position is defined by keyframes. The bits in between are all evaluated on the fly. Pink squiggle is the path that it takes & it's jittery cause of the resolution of the mesh underneath.

adk

nadiamask
07-25-2012, 03:14 AM
sorry to have kept you waiting

I mean " to make node setting which has same function as lw's motion plugin "sticky" "

so, first there should be way to evaluate vector from null to nearest polygon surface

adk
07-26-2012, 08:34 PM
sorry to have kept you waiting

I mean " to make node setting which has same function as lw's motion plugin "sticky" "

so, first there should be way to evaluate vector from null to nearest polygon surface

No probelm on the waiting part.

As for your other question ... I'm not 100% sure what sticky does as I've never used it to be honest. Only have a rough idea from seing videos of it in action ages ago.

One of the obvious things is that DP Nearest Point calculates what it describes ... nearest point info. So perhaps it will not do what you want unless your mesh is extremely dense. As you can see in the gif I posted, motion calculated via this method can be jittery.

The only way I know of evaluating nearest surface/poly information is to ray cast from your object. Then use that information to transform the motion. That's what's happening in the first gif.

nadiamask
07-29-2012, 05:17 AM
thanks for your interest
well I think it's not going to be possible for a while
cause there isn't exist node able to evaluate nearest surface coordinate

hope mr denis pontonie make it