// layer d'onde stationnaire déphasé for (x=0;x<640;x++) for (y=0;y<480;y++) { a=255*fabs(sin(0.1f*x)*sin(0.1f*y)); buffer[x+640*y]=a; a=255*fabs(sin(0.3f*x)*sin(0.3f*y)); e[x+640*y]=a; } float h=255; // application de E = m.c² + c.dv et de la loi de broglie l = h/p = h/mv sqrt(1-v²:c²) while (ReadEvents()) { clear_video(); SetPalette(256,dac2); memset(anim,0,640*480); for (x=1;x<640;x++) for (y=1;y<480;y++) { float e0=e[x+640*y]; float e1=e[x-1+640*y]; float e2=e[x+640*(y-1)]; float l0=buffer[x+640*y]; float l1=buffer[x-1+640*y]; float l2=buffer[x+640*(y-1)]; float dl1=l1-l0; float dl2=l2-l0; float dl=-h/((h/dl1) + (h/dl2) + e0 + e1 +e2); a=buffer[x+640*y]+dl; if (a-buffer[x+640*y]>128) anim[x+640*y]=255; buffer[x+640*y]=a; } memcpy(polys_video,buffer,640*480); VideoCpy(polys_video); Flip(); }