9
$\begingroup$

I am trying to create an animation of a wave propagating and passing through a double slit to undergo diffraction. The effect is something similar to the image attached:enter image description here

I have played with the wave modifier and dynamic paint (canvas for wave plane and brush for slit), but the wave will just propagate through the slit with no observable effect: enter image description here

I would appreciate any hints into how to achieve this effect.

$\endgroup$
12
$\begingroup$

final_giffinal_anim

Quality is butchered by gif format

final_pic

You will need 3 Dynamic Paint objects

objects

Canvas

Highly subdivided Plane with this settings:

canvas

Most important thing here is to set Timescale to 0.10 and Speed to 5. I don't know why but this way whole simulation is more stable.

Collision object

This is just a Brush with Waves > Type > Reflect Only

collision

Wave generator

Animated Cylinder Brush with Waves > Type > Depth Change. Also you can crank up Factor and Clamp Waves. Seems like these options are producing smoother result.

wave

Blend file

Here is file with used material and everything else:

$\endgroup$
5
$\begingroup$

The question is tagged 'dynamic paint' and there is already a very good answer about that by cgslav.

This solution uses a shader node tree.

enter image description here

Slits are located by two empties. One is moving to vary the effect (but this is not mandatory of course) and value node is keyed with frame number in order to produce the wave effect.

The overall node setting is the following:

enter image description here

On top, 3 parameters which correspond to:

  • A keyed value which is equal to the current frame
  • Wave speed
  • Wave frequency

On left, coordinates inputs, and from top to bottom:

  • Shaded object coordinates
  • Empty1 coordinates
  • Empty2 coordinates

Empties coordinates are added to the shaded object coordinates as this will reflect the empties locations.

If we don't want empties, 'vector' input from the 'sine' node groups can be used to locate the slits directly.

The two 'sine' result are then added and recentered to [0, 1] (they could be between [-2, 2] so we multiply by 0.25 and shift by 0.5.

The 'sine' node group:

enter image description here

It calculates the delta between the two vectors so that we can have it length (dot + sqrt).

Multiply frame by speed and add it to the length and multiply this result by the frequency.

Finally it takes the sinus (or cosinus) of it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.