'=========================================================================== ' Subject: 3D SINE GRAPH FOR BASEC Date: 06-24-99 (10:00) ' Author: The ABC Programmer Code: BEC, QB, QBasic ' Origin: voxel@edmc.net Packet: BASEC.ABC '=========================================================================== ' Converted to BASEC v0.20 by William Yu ' Yes, it does crash, but you get the idea. '=========================================================================== ' Subject: SINE GRAPH Date: 03-11-92 (10:20:00) ' Author: Rick Pedley Code: QB, QBasic ' Keys: SINE,GRAPH Packet: EGAVGA.ABC '=========================================================================== DIM SineRow(1 TO 240) AS SINGLE DIM SineCol(1 TO 350) AS SINGLE DIM X AS INTEGER DIM CF AS INTEGER DIM MAXVERTRES AS INTEGER DIM MAXHORZRES AS INTEGER DIM R AS INTEGER DIM P AS INTEGER DIM H AS INTEGER DIM C AS INTEGER DIM A AS INTEGER DIM Z AS INTEGER DIM UNDER AS INTEGER DIM T AS INTEGER DIM L AS INTEGER DIM K AS INTEGER DIM D AS INTEGER DIM G AS INTEGER FOR x = 1 TO 240 SineRow(x) = SIN(x / 10) * 30 NEXT x FOR x = 1 TO 350 SineCol(x) = SIN(x / 20) * 30 NEXT x SCREEN 12 CF = 1 MaxVertRes = 480 MaxHorzRes = 640 R = 0: P = 0: H = 0 C = 0: A = 0: Z = 0 Under = -1 'Change to 0 for no under side. T = 1: L = 1: K = MaxVertRes: D = 0: G = 0 Start: P = K FOR C = T + D TO 1 STEP -1 A = T + L: R = A - C: IF R > 240 THEN GOTO SkipSurface Z = (SineRow(R) + SineCol(C)) + 150 H = K - Z - R IF H >= P OR H < 0 THEN GOTO Underside P = H: PSET (A - 1, P), 9 '<-Try 10,12,13,etc. Underside: IF Under THEN IF R = L OR R = L + 1 THEN G = H + 5: GOTO SkipUnder IF H <= G THEN GOTO SkipUnder G = H: IF G > MaxVertRes THEN GOTO SkipUnder PSET (A - 1, G), 1 '<-Try 2,4,12, etc. END IF SkipUnder: NEXT C SkipSurface: IF A = MaxHorzRes THEN GOTO Done T = T + 1 IF T > 350 THEN T = 350 L = L + 1: D = D + 1 IF D = CF THEN D = 0 END IF GOTO Start Done: DO LOOP UNTIL INKEY$<>"" END