How to draw a sine wave of changing wavelength?

Hi. I would like to draw a 2D sine wave onto 3D ‘paper’. The wavelength of the sine wave will change. The user will hopefully see the sine wave, with all the wavelength changes, on the ‘paper’. My brain and abilities are stumped; how does one have the animation ‘remember’ previous information without making the computer work hard? Any ideas, anyone? I’ve barely started, as the answer to this question will drive everything.

well, you need to start somewhere,

here is an animated sign wave at least.

Edit : updated the demo to have a GUI to change amplitude and frequency

2 Likes

float value = sin(time * desiredWavelength); ?

Thanks, Seanwasere!.. very useful answer, provided incredibly quickly… thankyou. Now I add orbitcontrol, and I’m on my way. Thank you again.

I don’t know the final result you want to achieve, but, as an option, you can use a CanvasTexture to draw and to animate anything.

Video:

Demo: https://codepen.io/prisoner849/full/KwPLEQv

4 Likes