Moving individual vertices of a grid surface

So I have a simple grid surface of which boundary edges are static and I want to move individual vertices of the surface vertically. This movement is influenced by a point on another surface which I can control through TouchOSC and send the position of the point back to grasshopper. Attaching a diagram for explanation:

Let’s imagine that person is a moving point on lower surface that informs the movement of the upper surface. Upper surface would have every second vertice moving up and every other one moving down in regards to a distance to the person underneath.

I have created a similar definition that pulls the vertices from the surface using closest point component, however, in this case I want to control individual vertices and not move a point. Attaching an example of my current definition (which does not do what I want):

My problem is that even when I try to split vertices of the surface into 2 lists (1 is moving up and 1 is moving down) and put them back together, I mess up the branching or their exact index on the surface and the surface turns out wrong. Anyone has any idea how this could be done?

responsive_movement.gh (14.8 KB)

EDIT: Attaching screenshot of a current script and .gh definition

Check attachment if you want. And…

I don’t understand what you mean. What point?

CeilingDeformByAttractor_re.gh (16.5 KB)

Thank you for answering and sorry for not being clear enough. Let me explain it in other words.

I don’t understand what you mean. What point?

In both, your and mine, solutions it’s almost as if you take a “pinched cilinder mould” and then move it across the surface (whether from the bottom of the surface and pinching upwards or the pushing the mould downwards and moving around). What I’m looking for is to have a “pre-stressed surface” where some vertices are being pulled up and some are being pulled down. When you introduce a point (or it can also be a curve), vertices of the surface that are at the certain distance to that reference point/curve move upwards. This pre-stress of the vertices is taken into cosideration and it creates resistance when moving them up/down (see attached image. Red dots - vertices being pulled up, blue dots - vertices being pulled down).

Default state:

Surface is being pulled up in relation to a reference curve (the curve runs across the middle of the surface):

So if I’m understanding correctly, it is important to have control of pre-stress of different vertices and then their vertical movement (withe resistance from pre-stress) when a reference point/curve is introduced.

Bravo HS_Kim.

I must say, my grasshopper game is nowhere close to building this on my own. Not only you made it work, I appreciate the time you took to make it clean and understandable. Sorry if my initial request didn’t make much sense. I guess lack of experience makes it hard to put into words.

Just analyzing the script, it didn’t even ring to me to build the surface the way you did instead of using a traditional approach and then trying to extract points from it. Your approach seems more logical and allows for more control.

Thank you again, this community deserves more credit