Sine waves travelling at any angle through 3D space
in
Programming Questions
•
6 months ago
Hello all,
Thanks very much,
Does anybody know how to code the movement of a sine wave through 3D space? I'd like to have the wave move through space at any definable angle but can't think how to make this happen.
Here is where I'm at so far:
- float x1 = 0;
- void setup() {
- size(500, 500);
- smooth();
- }
- void draw() {
- background(255);
- int pitch = 440;
- for (float i = x1; i < x1+50; i += 0.1) {
- point(i, height/2+sin(pitch*i)*20);
- }
- x1++;
- }
Adam
1