Plane follows terrain: how?

I want a (small) plane to follow (glide over) a (large) terrain. So, as the plane moves I think it's vertex coordinates need to be set equal to those of the closest point on the terrain.
Unfortunately I have no idea how expressions should look to get this done.
Thanks for all your help.

I would think a projected displacement map of some sort would be a good thing to look into.

Hope this helps.
-James

Create a locator
Parent the plane to the locator
Geometry constrain locator to the terrain

Thanks for your suggestions, however:
@arcsecond:
Good idea. I managed to create a displacement map for the big terrain but still looking on how to use a small part of this map as a displacement map for the small plane. I don't know what you mean by 'projected displacement map'. I should take a small portion of the big map at the current position of the plane, but how?
@failure:
This works but the small plane doesn't follow the terrain geometry. I want this plane to take the geometry of the terrain at its current position (like a piece of cloth that glides over a terrain). With your solution, the geometry of the small plane (cloth patch) is not changed. Every vertex should be set to the closestpoint on the terrain surface imo.

Still struggling with this one.

You can add the texture nodes value to your constrains value. By plugging the contrain to aplus minus average and by using the closest point on surface nodes out plugged to a copy of your texturing node wich feed its output to the plus minis average node that feeds to the plane.

Ok now this Will forllow the contour rather EXACTLy so you may wish to filter the texture a bit more for smoother flight.

Or something more kinky. If your terrain is nurbs surface; duplicate it and move it up the y axis. Now create a closed rectangular curve and project it to a second surface ( in the y direction ). Trim the second surface. Animate the curve.

With this you even get a realtime preview

You actualky get a realtime prewievfor the planbe with hybrid method too... And if you use a heightfield node then for the displacement too as long as the plane is flat.

Just note that using closestPointOnSurface doesn't give you what you want in every situation here i. e. you might end up with the wrong point. What you need is projection ( in y direction ) of the point to the surface

In this case it does since we use a surface constraint thats ON the surface and then divert the data to closest point on surface to get the uvs. (im nit sure but surface constarint mighyt allready yeald this).

A closte point on a poit thats on a surfece is that one point!

Ok. You're right. I was not thinking straight.
But I really don't see the need for a constrain node in this case. You can just make one big and one small plane and planar project the same displacement on both. Just as the first reply suggested.

your right... on could directly read the 3d texture... But in all honestly its better to do a shape like ocean does and displace that! now the tesselation doesnet grow out suddenly but evenly makeing for no displacement gaps!

Thank you for all the suggestions.
The 'kinky nurbs trick' didn't work for me: the closed curve (projected on the terrain) follows the terrain but when I trim the surface, the geometry of the small patch no longer changes when the curve moves.
As for the displacement solution: although its not clear to me how the project the map on both, there seems to be another problem: I cannot get those 'displacement terrains' to look as good as nurbs terrains.

If you want, you can always take a look here.

"The 'kinky nurbs trick' didn't work for me:"

Oh but it does work perfectly. You must animate the source curve, not the projected one. And be sure to delete the history of the source curve.

Displacement:
Try to enlarge the normal threshold in displacement attributes of the surface

@failure:
1. Kinky nurbs solution: here's what I did: here.
Strange things:
- patch disappears & terrain is dispalyed (with hole at patch location)
- deleting the history on the curve: patch no longer follows curve movements
2. Dipslacement maps:
'Try to enlarge the normal threshold in displacement attributes of the surface':
No effect.

Thanks for your time to take a look at this prob.

Ok. Let's fix the kinky nurb. If you won't be happy with it then we'll discuss displacement.

I'll make corrections to your steps:

  1. Delete the history of the curve before you project it. Make sure that curve is above highest point of the surface.

  2. When trimming, place the little yellow trim locator anywhere on the surface. Press enter to finish trim operation. Now select trimmed surface, open attribute editor and select trim node ( trim1 ). Here set "selected" to "discard", "LocatorU" and "LocatorV" to 0.

@failure:
Thanks a lot (once more).
The kinky way is working perfect.
So, it's time for the next step: the emitter.
I've created an emiietr (directional for simplicity) and instanced the curve. Curves are emitted but corresponding patches on the terrain aren't generated.
Take a look at this image :
- dark green: terrain
- light green: original curve
- yellow: moving patch (follows curve)
- purple: emitted curves
So:
1. How make the emitted curves to get projected on the surface & create moving patches.
2. How to use a bitmap as texture map for the terrain patches? When using a bitmap for the terrain copy, the bitmap fills the whole surface. In some way, I have to find out what '2d texture placement attributes' are required to fit the bitmap on the patch. This might become very difficult because the fitting has to be adapted every frame because the patch changes size and shape when it moves over the terrain.

Failure, feel free to stop responding when I ask too much questions. No problem, I understand.

You can't do this with instanced geometry particles.
What's the final goal here? How many of these patches do you need?

Maybe I should I have explained in the beginning what I was looking for. The idea is to create an emitter of sprites for which each sprite changes geometry along its path: it takes the geometry of the underlying terrain. So, these are not the normal sprites always facing the camera. On the sprites are seamless loops of image sequences projected. So there are lots of sprites/patches in the scene.
If things are still unclear, please tell me.

Yes, but what's important here is what kind of control of the system you need to have. Do you really need all that maya particles can do? Or you can get away with animating it by hand. What is the final-final scene/animaton/look/purpose you are after?

This may sound like one-track-minded thinking but that's the logic we use when creating computer graphics. First we decide exactly what we want to do, then try to do it with minimal resources that give the desired result.

Why build a system that handles milion superfly-thingies when all you need is system for dozen of slow-walking-thingies. Especially when you need to pay several work hours per thingie.

The thing you are asking can be made on yet more different ways than discussed so far. It all depends.
You need to describe exactly what you want, i. e. what your final shot needs to look like.

Ok, got your point. Lets create a waterfall.
Look here to get an idea of what I'm after. I appologize for the poor quality of the drawing.
A particle emitter emits sprites that have the surface as a goal. On each sprite a seamless sequence of images is projected. When the sprites start falling down, they need to bend to follow the underlying surfaces geometry. If not, artifacts show up.
Do not hesitate to correct me if I'm still not clear enough. I'm a newbie and gladly accept all critics.