home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / os2rndr.zip / RENDER.CMD < prev    next >
OS/2 REXX Batch file  |  1993-11-22  |  4KB  |  142 lines

  1. /* Ray Tracing Procedure with Graphical */
  2. /* user interface  for use with OS/2 version */
  3. /* of POVRAY 1.0 or 2.0 */
  4. /* Written by:  Greg Spath */
  5. /* last revision 11/22/93 */
  6.  
  7. '@echo off'
  8. call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  9. initcode = VInit()
  10. if initcode = 'ERROR' then signal CLEANUP
  11.  
  12. signal on failure name CLEANUP
  13. signal on halt name CLEANUP
  14. signal on syntax name CLEANUP
  15.  
  16. /*--------------------------------------------------- */
  17. /* Set these up to match your system */
  18. /*----------------------------------------------------*/
  19.  
  20. init = "c:\proc\render.ini"             /* file that contains the last in/out file names */
  21. program="d:\render\povray"   /* directory and name of ray-tracer */
  22. datadrive="d:"                              /* default drive for  data file */
  23. datadir="\data\raytrace"           /* default directory for data file */
  24.  
  25. START:
  26. call VDialogPos 50, 50
  27. parse arg infile outfile
  28. afile = linein(init,1,1)
  29.  
  30. if infile = '' then infile = afile
  31. if outfile = '' then outfile = linein(init)
  32. datadrive
  33. cd datadir
  34.  
  35. prompt.0 = 2   /* 2 prompt lines */
  36. prompt.1 ='Input File Name'
  37. prompt.2 = 'Output File Name'
  38.  
  39. width.0 = 2
  40. width.1 = 30  
  41. width.2 = 30   
  42.  
  43. hide.0 = 2
  44. hide.1 = 0     
  45. hide.2 = 0     
  46.  
  47. fname.0 = 2
  48. fname.1 = infile  
  49. fname.2 = outfile  
  50.  
  51. button = VMultBox('Choose file to Render', prompt, width, hide, fname, 3)
  52.  
  53. if button = 'OK' then do
  54.         infile = fname.1
  55.         outfile = fname.2
  56.         call FIXNAME
  57.         call lineout init, infile, 1
  58.         call lineout init, outfile
  59.         call lineout init
  60.         call RESOLUTION
  61. else 
  62.         exit
  63.  
  64. RESOLUTION:
  65.         res.0 = 6
  66.         res.1 = '80 x 60'       
  67.         res.2 = '320 x 200'     
  68.         res.3 = '640 x 480'     
  69.         res.4 = '800 x 600'     
  70.         res.5 = '1024 x 768'    
  71.         res.6 = 'custom'
  72.  
  73.         call VRadioBox 'Select a Resolution', res, 1
  74.         if res.vstring = '80 x 60' then do
  75.                 width = 80
  76.                 height = 60
  77.         end
  78.         if res.vstring = '320 x 200' then do
  79.                 width = 320
  80.                 height = 200
  81.         end 
  82.         if res.vstring = '640 x 480' then do
  83.                 width = 640
  84.                 height = 480
  85.         end  /* Do */
  86.         if res.vstring = '800 x 600' then do
  87.                 width = 800
  88.                 height = 600
  89.         end  /* Do */
  90.         if res.vstring = '1024 x 768' then do
  91.                 width = 1024
  92.                 height = 768
  93.         end  /* Do */
  94.         if res.vstring = 'custom' then call CUSTRES
  95.                    
  96. VERSION:
  97.         ver.0 = 2
  98.         ver.1 = '1.0'
  99.         ver.2 = '2.0'
  100.         call VRadioBox 'Which Version of POV?', ver, 1
  101.         version = ver.vstring
  102. DO_IT:
  103.        program' +i'infile' +o'outfile' +w'width' +h'height' +ld:\render\include +x +v +P +B128 +FT +MV'version
  104.  
  105. CLEANUP:
  106.         call VExit
  107.         exit
  108.  
  109. CUSTRES:
  110. prompt.0 = 2   /* 2 prompt lines */
  111. prompt.1 = 'Horizontal Resoultion'
  112. prompt.2 = 'Vertical Resolution'
  113.  
  114. width.0 = 2
  115. width.1 = 5   /* widths in character units */
  116. width.2 = 5    /* for both entryfields */
  117.  
  118. hide.0 = 2
  119. hide.1 = 0     /* echo the User ID input */
  120. hide.2 = 0     /* don't echo the Password */
  121.  
  122. resol.0 = 2
  123. resol.1 = 32  /* these are the default strings */
  124. resol.2 = 32  /* which will contain the input */
  125.  
  126. button = VMultBox('Choose file to Render', prompt, width, hide, resol, 3)
  127.  
  128. if button = 'OK' then do
  129.         width = resol.1
  130.         height = resol.2
  131.         return
  132. else
  133.         call RESOLUTION
  134.  
  135.  
  136. FIXNAME:
  137.    if \ (substr(infile, length(infile) -3, 1) = '.') then
  138.       infile = infile'.pov'
  139.    if \ (substr(outfile, length(outfile) - 3, 1) = '.')  then
  140.       outfile = outfile'.tga'
  141.    return
  142.