home *** CD-ROM | disk | FTP | other *** search
- DECLARE SUB DRAWDOTS (WID!)
- DECLARE SUB RANDSTRIP (WID%, XFGCLR%, XBGCLR%)
- DECLARE SUB COMLINE (NumArgs%, ARGS$(), MAXARGS%)
- DECLARE SUB THREED (WID%, DEPTH%)
- CONST VSIZE = 350, MAXARGS = 1
- DIM ARGS(1 TO MAXARGS) AS STRING
- DIM PICNAME AS STRING
- DIM SHARED SEED AS LONG
- CALL COMLINE(NARGS%, ARGS(), MAXARGS)
- IF NARGS% <> MAXARGS THEN GOTO INSTRUCTIONS
-
- PICNAME = ARGS(1)
- SCREEN 9
- FGCOLOR% = 0
- BGCOLOR% = 15
- SHELL "VPIC " + PICNAME + " /A /R"
- RANDOMIZE TIMER
- CONST WIDE = 60
- CALL DRAWDOTS(WIDE)
- CALL RANDSTRIP(WIDE, FGCOLOR%, BGCOLOR%)
- CALL THREED(WIDE, 5)
- WHILE INKEY$ = ""
- WEND
- END
-
- INSTRUCTIONS:
- SCREEN 0
- COLOR 11, 1
- PRINT "Usage: 3DEGA Pic-Filename(650x350x16)"
- PRINT
- PRINT "This program takes a picture file and displays it using a picture viewer"
- PRINT "like VPIC 4.5 from Bob Montgomery. The picture file must be EGA"
- PRINT "650 x 350 and with 16 colors."
- PRINT
- PRINT "Once the picture is displayed, it is converted into a 3D random dot"
- PRINT "stereogram. The height of objects in the 3D picture are based on the"
- PRINT "numerical value of the colors. Black = 0, Blue = 1, etc."
- PRINT "After the stereogram is completed, use a screen capture program to"
- PRINT "save it to disk or hit Print Screen to print it on a graphics printer."
- PRINT
- PRINT "Note: If you are going to use DOS 5 QBASIC, remove subproc COMLINE."
- PRINT
- END
-
- DEFINT A-Z
- SUB COMLINE (NumArgs, ARGS$(), MAXARGS) STATIC
-
- CONST TRUE = -1, FALSE = 0
-
- NumArgs = 0: in = FALSE
- ' Get the command line using the COMMAND$ function.
- Cl$ = COMMAND$
- L = LEN(Cl$)
- ' Go through the command line a character at a time.
- FOR I = 1 TO L
- C$ = MID$(Cl$, I, 1)
- 'Test for character being a blank or a tab.
- IF (C$ <> " " AND C$ <> CHR$(9)) THEN
- ' Neither blank nor tab.
- ' Test to see if you're already
- ' inside an argument.
- IF NOT in THEN
- ' You've found the start of a new argument.
- ' Test for too many arguments.
- IF NumArgs = MAXARGS THEN EXIT FOR
- NumArgs = NumArgs + 1
- in = TRUE
- END IF
- ' Add the character to the current argument.
- ARGS$(NumArgs) = ARGS$(NumArgs) + C$
- ELSE
- ' Found a blank or a tab.
- ' Set "Not in an argument" flag to FALSE.
- in = FALSE
- END IF
- NEXT I
-
-
-
- END SUB
-
- DEFSNG A-Z
- SUB DRAWDOTS (WID)
- X = 640 / 2 - WID / 2
- CIRCLE (X, 4), 4, 16
- PAINT STEP(0, 0), 16
- CIRCLE (X + WID, 4), 4, 16
- PAINT STEP(0, 0), 16
- END SUB
-
- DEFINT W-Z
- SUB RANDSTRIP (WID, XFGCLR, XBGCLR)
- FOR Y = 10 TO VSIZE - 1
- IF INKEY$ <> "" THEN END
- FOR X = 0 TO WID - 1
- IF RND > .55 THEN
- COLOR XFGCLR
- ELSE
- COLOR XBGCLR
- END IF
- PSET (X, Y)
- NEXT X
- NEXT Y
- END SUB
-
- DEFINT A-V
- SUB THREED (WID, DEPTH)
- FOR ROW = 1 TO 640 / WID - 1
- IF INKEY$ <> "" THEN END
- XROW = WID * ROW
- FOR Y = 10 TO VSIZE - 1
- FOR X = 0 TO WID - 1
- THISX = XROW + X
- THISPIX = POINT(THISX, Y)
- THISPIX = POINT(THISX - WID + THISPIX, Y)
- PSET (THISX, Y), THISPIX
- NEXT X
- NEXT Y
- NEXT ROW
- END SUB
-
-