www.pudn.com > wave.zip > WAVE.CPP
#include#include #include #include #include #include #define PI 3.1415926535 #define L 40 #define E 2 #define ELS 1 #define MAS 10 #define FR 1.01 typedef unsigned char byte; char far*VGA=(char far*)0xA0000000L; float CX=320/PI,CY=200/PI;int MED=1; void putpixel(int x,int y,int c){VGA[x+320*y]=c;} struct punto{float v,p;}; punto*m=(punto*)malloc(L*L*sizeof(punto)); void draw(int n,int c){ float x=E*(L/2-n%L+.5), y=E*(L/2-n/L-.5), z=m[n].v; //putpixel(160+x*2,37-z,15*c); z+=30;if(z>0)putpixel(160+atan(x/z)*CX,100-atan(y/z)*CY,z*c); } main() { REGS vga;vga.h.ah=0x00;vga.h.al=0x13;int86(0x10,&vga,&vga); REGS mouse; int n,k; for(n=0;n L)m[n].p+=(m[n-L].v-m[n].v)/ELS;} for(n=0;n