Hey!
I’m trying to modulate a mesh 3D grid with a sine wave in a rotated direction. That is, I want the sine wave to be rotated relative to the mesh, such that it is affecting the mesh on an angle.… This was my attempt, however it does not seem to do anything. Moving the rotate around the mesh.draw, just rotates everything - not the sinewave in relation to the mesh.
ofPushMatrix();
ofRotateZ(40);
ofRotateX(40);
float time = ofGetElapsedTimef();
for (int y=0; y<H; y++) {
for (int x=0; x<W; x++) {
int i = x + W * y;
ofPoint p = mesh.getVertex( i );
float amp = x/40.0 + time;
float zScale = 10*sin(amp);
p.z = zScale;
mesh.setVertex( i, p );
}
}
ofPopMatrix();
Thanks