# Compressional wave in a cube

I want to see the propagation of a compressional wave in a cube. I meshed a cube along Y and just added wave in this same direction as follows:

But only the first and the last Y normal surfaces move while the rest of the cube remains completely still. How do you get all the surfaces to move to illustrate the propagation of a compression/dilatation wave through the cube?

• You may have to delete the surrounding geometry, that is all the short edges. May 17 at 13:08
• i do not think that this is possible...but...surprise me! ;) May 17 at 13:13
• In which direction do you want the compression? Longitudinal (along Y), or transverse (in XZ) ? May 17 at 14:32
• longitudinal, along Y. For transverse it's ok. May 17 at 15:15

For illustration, you could pass an Empty down the length of the cube, create a vertex group in the cube, (say, 'Prox',) and give the cube a Vertex Weight Proximity modifier, modifying the weights in the group by the proximity of the Empty.

Here, we see the Vertex Weight Proximity modifier, affecting the 'Prox' group, targeted on the plain-axis Empty, and the consequent weights (made visible in the 'Overlay' settings,in Edit Mode).

Those weights can then be used to control other modifiers. For longitudinal compression, you could parent a plane to the Empty, and give the cube a Shrinkwrap modifier, projected in + and - of the length-axis (mine is X) towards the plane, weighted by the 'Prox' group:

If, for example, you wanted a leading compression front, rather than contraction on both sides of the plane, you could get the shrinkwrap to project on one side only.

This, though, is as shown:

For transverse compression, you could use a Displace (along normals) modifier instead of the shrinkwrap.. no need for the plane:

If you needed something more mathematically exact, I'm sure there will be a Geometry Nodes solution. For that, maybe you could provide your wave function.

• Warp modifier could let you skip the proximity, if what you want is just a loc/rot/scale transformation. May 17 at 15:30
• Hi @Nathan! I'm not very experienced with Warp .. please post an answer if you have time, if not , I'll have a play with it when I do. May 17 at 15:33
• Woooooowwwwwwwww May 17 at 15:38
• It kind of demands animation demo, and I've never figured out a good, easy enough way to show that here-- do you viewport render and convert to gif using a different application? Gif is so painful.... May 17 at 15:48
• @Nathan is right.. Warp gives you the choice of a custom falloff curve, which might be just what would suit this case. I use Bligify to convert viewport animations (Linux) May 17 at 15:49

A warp modifier is a nice way to do this:

It measures the transformation from one empty to another empty, and then applies the transformation to the mesh in a given radius, with a specified, even custom curve, falloff. The radius is measured from the "object from" object, which can then be animated along the length of the curve. I typically parent the "to" object to the "from" object. The scale of the "to" object is shown in my sidebar; that's the transformation the mesh is undergoing.

• Cheers! Must get my head round this one. May 17 at 15:59
• Hi Nathan, nice idea. Where is your second empty on your example ? thx May 17 at 17:52
• They're both at the same location. Both are selected in the still; the active selection is the "to" and the secondary selection is the "from." May 17 at 18:03
• tks, But in the blender new version, empty properties is different and dont offer the same menu at all... and cant find a tuto about that.. i.goopics.net/JqKra.png May 17 at 19:23
• The modifier isn't on the empty, it's on the mesh. That's version 2.92, the latest release, and there haven't been any differences to empties for a long time anyways. May 17 at 19:29

To add to the very functional answers already here, I would use a Lattice modifier with a moving Lattice object.

This allows for not only compression waves, but also transverse waves and even spacially asymmetric combinations of transverse and compression waves with arbitrary waveforms:

• I honestly don't know why my answer is attracting so much UV.. I think both yours and @Nathan's suit the OP better. You have to play with the lattice a bit, to understand the difference between transforming it in Edit and Object mode, but in the end it can do everything in my answer, more simply. May 18 at 18:57