home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / graf / dancad2.zip / DEMOMAIN.MAC < prev    next >
Text File  |  1987-12-02  |  12KB  |  436 lines

  1. ; DEMOMAIN.MAC, demo for DANCAD3D v2.0 release version
  2.  
  3. ; Copyright (c) 1987, Daniel H. Hudgins, All rights reserved.
  4. ; The latest set of disks and manual can be ordered from me.
  5. ; Write to: DANCAD3D, 466 Diamond St., San Francisco, CA 94114.
  6.  
  7. ; Begin set up
  8.  
  9. INIT               ; clear DANCAD3D's workspace
  10. WORLD 240          ; set world scale to inches
  11.  
  12. ; End Set up
  13.  
  14. ; Begin intro massage
  15.  
  16. TEXT_MODE
  17.  
  18. LOCATE 1 4
  19. ECHO                      DANCAD3D v2.x demo macro DEMOMAIN.MAC
  20. LOCATE 1 6
  21. ECHO     DANCAD3D  can  run  it  self  from  an  ASCII text file of commands.  These
  22. ECHO commands let you initiate powerful and complex series of operations on drawings
  23. ECHO and 3D environments with a single filename for that text file.  You can put any
  24. ECHO number of commands in one of these files so they are called macros.  Macros are
  25. ECHO big  jobs  given  a  simple  user defined name.   DANCAD3D gives you a valuable
  26. ECHO kernel to start with,  you can then  extend  it  to  any  degree  filling  your
  27. ECHO harddisk  with  procedures  and functions that can call each other.  Since v2.x
  28. ECHO has commands to format the text  on  screen  and  have  user  console input and
  29. ECHO output you can design data entry menus  for  the  sale of custom macros for all
  30. ECHO kinds of applications.
  31. LOCATE 1 17
  32. ECHO     This  is  a  simple  example  since the distribution disk space is limited.
  33. ECHO More complex examples come as part of the 14 disk set.
  34. LOCATE 1 20
  35. ECHO     Press [Return] to continue.
  36.  
  37. WAIT
  38.  
  39. ; End intro message
  40.  
  41.  
  42. ; Begin make Small Gear
  43.  
  44. TRACE OFF 500 ; just in case is was left on
  45.  
  46. TEXT LOCATE 25 12 ECHO <WORKING: Making the small gear> %%
  47.  
  48. INIT
  49.  
  50. ; tooth
  51.  
  52. ENTER_DATA
  53. 231 -60 -50 331 -40 -50 1 1 0 0
  54. 331 -40 -50 331 40 -50 1 1 0 0
  55. 331 40 -50 231 60 -50 1 1 0 0
  56. 231 60 -50 231 -60 -50 1 1 0 0
  57. 231 -60 50 331 -40 50 1 1 0 0
  58. 331 -40 50 331 40 50 1 1 0 0
  59. 331 40 50 231 60 50 1 1 0 0
  60. 231 60 50 231 -60 50 1 1 0 0
  61. 231 -60 50 231 -60 -50 1 1 0 0
  62. 331 -40 50 331 -40 -50 1 1 0 0
  63. 331 40 50 331 40 -50 1 1 0 0
  64. 231 60 50 231 60 -50 1 1 0 0
  65. 0 0 0 0 0 0  0 0 0 0
  66.  
  67. TRACE ON 0
  68.  
  69. :SMALL
  70. # 1 COPY
  71. LET ELES -> ELEMENTS
  72. # ELES ROTATE Z 0 0 [ 45 * ( ELES - 1 ) ]
  73. IF ELES < 8 THEN GOTO :SMALL
  74. RELEASE ELES
  75.  
  76. POLYGON 8 8 250 1 1 0 0  #  9 ROTATE Z 0 0 22.5 #  9 OFFSET C 0 0 -50
  77. #  9 THICKEN Z 100
  78. POLYGON 24 24 75 1 1 0 0 # 10 OFFSET C 0 0 -50 ; hole
  79. # 10 THICKEN Z 100
  80.  
  81. # 0 MAGNIFY Z 1 1 2
  82.  
  83. # 0 SAVE 3D-Quick SMALL.3D
  84.  
  85. TRACE OFF 500   ; set delay for next use
  86.  
  87. ; End make a Small Gear
  88.  
  89.  
  90. ; Start show Small Gear
  91.  
  92. GRAPH_MODE B&W
  93.  
  94. # 0 DISPLAY -11.25 -11.25 0 -1500 1.8 1 0 0
  95.  
  96. LOCATE 1 1 ECHO The Small Gear.  Press [Return].
  97. WAIT
  98.  
  99. ; End show Small Gear
  100.  
  101.  
  102. ; Start Make the Large Gear
  103.  
  104. TEXT LOCATE 25 12 ECHO <WORKING: Making the Large Gear> %%
  105.  
  106. INIT
  107.  
  108. ; tooth
  109.  
  110. ENTER_DATA
  111. 491 -60 -50 591 -40 -50 1 1 0 0
  112. 591 -40 -50 591 40 -50 1 1 0 0
  113. 591 40 -50 491 60 -50 1 1 0 0
  114. 491 60 -50 491 -60 -50 1 1 0 0
  115. 491 -60 50 591 -40 50 1 1 0 0
  116. 591 -40 50 591 40 50 1 1 0 0
  117. 591 40 50 491 60 50 1 1 0 0
  118. 491 60 50 491 -60 50 1 1 0 0
  119. 491 -60 50 491 -60 -50 1 1 0 0
  120. 591 -40 50 591 -40 -50 1 1 0 0
  121. 591 40 50 591 40 -50 1 1 0 0
  122. 491 60 50 491 60 -50 1 1 0 0
  123. 0 0 0 0 0 0  0 0 0 0
  124.  
  125. TRACE ON 0
  126.  
  127. :LARGE
  128. # 1 COPY
  129. LET ELES -> ELEMENTS
  130. # ELES ROTATE Z 0 0 [ 22.5 * ( ELES - 1 ) ]
  131. IF ELES < 16 THEN GOTO :LARGE
  132. RELEASE ELES
  133.  
  134. POLYGON 16 16 500 1 1 0 0 # 17 ROTATE Z 0 0 11.25 # 17 OFFSET C 0 0 -50
  135. # 17 THICKEN Z 100
  136. POLYGON 24 24 75 1 1 0 0  # 18 OFFSET C 0 0 -50 ; holes
  137. # 18 THICKEN Z 100
  138.  
  139. # 0 MAGNIFY Z 1 1 2
  140.  
  141. # 0 SAVE 3D-Quick LARGE.3D
  142.  
  143. TRACE OFF 500 ; delay to 1/2 second , turn it off
  144.  
  145. ; End of Make Large Gear
  146.  
  147.  
  148. ; Start show Large Gear
  149.  
  150. GRAPH_MODE B&W
  151.  
  152. # 0 DISPLAY -11.25 -11.25 0 -2000 .9 1 0 0
  153.  
  154. LOCATE 1 1 ECHO The Large Gear.  Press [Return].
  155. WAIT
  156.  
  157. ; End show Large Gear
  158.  
  159.  
  160. ; Begin Show Gears Pair Still
  161.  
  162. TEXT LOCATE 25 12 ECHO <WORKING: Making the Gear Pair> %%
  163.  
  164. INIT
  165.  
  166. LOAD 3D-Quick SMALL.3D # 1 OFFSET C -302 0 0 # 1 ROTATE C 0 0 22.5
  167. LOAD 3D-Quick LARGE.3D # 2 OFFSET C  552 0 0
  168. FILES ERASE SMALL.3D
  169. FILES ERASE LARGE.3D
  170.  
  171. ; border, this was drawn in [F] (front) from main menu and brought in
  172. ; by saving it ASCII and reading it in with ^K^R. It could just as well
  173. ; be on a file, but this saves disk space.
  174.  
  175. ENTER
  176. -955 -648 0  955 -648 0 1 1 0 0
  177.  955 -648 0  955  648 0 1 1 0 0
  178.  955  648 0 -955  648 0 1 1 0 0
  179. -955  648 0 -955 -648 0 1 1 0 0
  180. 0 0 0 0 0 0  0 0 0 0
  181.  
  182. Lettering
  183. DANCAD 3D
  184. -900 555 0 0 0 0 80 80  3 1 0 0  0 .4 .35 1 F P DanCAD3D.Fon
  185.  
  186. GRAPH_MODE B&W
  187.  
  188. # 1 Display 0 -18 0 -4000 .88 1 -320 0
  189. # 2 Display 0 -18 0 -4000 .88 1 -320 0
  190. # 3 Display 0  0  0 -1E18  1  1    0 0
  191. # 4 Display 0  0  0 -1E18  1  1    0 0
  192.  
  193. LOCATE 2 2 ECHO Press [Return].
  194. WAIT
  195.  
  196. ; End Show Gears Pair Still
  197.  
  198.  
  199.  
  200. ; Begin Show Gears Pair Moving
  201.  
  202. TEXT_MODE
  203.  
  204. ECHO      DEMOMAIN.MAC demo for DANCAD3D v2.x release version, FIRST ANIMATION.
  205. ECHO -
  206. ECHO     The next part of this demo shows how you can animate wire frames.  It is  a
  207. ECHO perspective  view  of gears turning.  It turns 3 teeth then goes on to show you
  208. ECHO some more animation.  If you used INSTALL there is a  subdirectory  named  \PIX
  209. ECHO that will hold the frame files, otherwise you need to make one from DOS and run
  210. ECHO the demo again, i.e. C>MD PIX from DANCAD3D's directory.
  211. ECHO -
  212. ECHO     If  you  order  the 14 disks and manual disks for $35 you will get DANMOVIE
  213. ECHO v2.x a program that lets you run sets of pixel frame files from memory  rapidly
  214. ECHO and  smoothly with motion forward,  reverse,  and,  back & forth,  at different
  215. ECHO speeds.  It is useful to see how action will look in a  film-video and  to  see
  216. ECHO how parts fit.  DANMOVIE v2.x supports color CGA, b&w EGA, and Hercules (tm).
  217. ECHO -
  218. ECHO     Press  [Return]  then ^X if you have seen all of the demo and want to print
  219. ECHO out the perspective drawing of the gears.  Then press [H] (for hard copy)  then
  220. ECHO [D] [W] for dot or [P] [P] for plotter.
  221. ECHO -
  222. ECHO     The  frames that fallow are not all the same,  if you look closely you will
  223. ECHO see that the gears turn a little between frames.  When  they  are  run  rapidly
  224. ECHO they will look like they are moving.
  225.  
  226. LOCATE 1 25 ECHO Press [Return] to continue the demo. %%
  227.  
  228. WAIT_FOR_RETURN
  229.  
  230. TEXT LOCATE 23 12 ECHO <WORKING: Animating the Gear Pair> %%
  231.  
  232. DELAY 1000 ; to give time to press ^X
  233.  
  234. NAME 1 = PIX\DEMOFR-A 0
  235.  
  236. LET FRAMES = 1
  237. :FIRST_ANIMATION
  238. GRAPH_MODE B&W
  239.  
  240. # 1 Display 0 -18 0 -4000 .88 1 -320 0
  241. # 2 Display 0 -18 0 -4000 .88 1 -320 0
  242. # 3 Display 0  0  0 -1E18  1  1    0 0
  243. # 4 Display 0  0  0 -1E18  1  1    0 0
  244.  
  245. SAVE PIXEL NAME 1 NEXT
  246.  
  247. LOCATE 2 2 OUTPUT FRAMES ECHO  frames down, %%
  248. OUTPUT [ 20 - FRAMES ]   ECHO  to go.
  249. LET FRAMES = [ FRAMES + 1 ]
  250.  
  251. # 1 ROTATE C 0 0  2.25
  252. # 2 ROTATE C 0 0 -1.125
  253. LOOP :FIRST_ANIMATION 19
  254.  
  255. RELEASE FRAMES
  256.  
  257. BEEP ; so you can know when it is done
  258. LOCATE 2 2 ECHO Press [Return] to start.
  259. WAIT
  260.  
  261. LET FRAMES = 20 ; pass number of frames to DEMO-SUB.MAC
  262. LET FNAME  =  1 ; pass ordinal value for frame set name
  263.  
  264. RUN DEMO-SUB.MAC ; call subroutine
  265.  
  266. RELEASE FRAMES ; clean up disk space
  267. RELEASE FNAME
  268.  
  269. ; End Show Gears Pair Moving
  270.  
  271.  
  272.  
  273. ; Begin Show Gears in close up of Pair Moving
  274.  
  275. TEXT_MODE
  276.  
  277. ECHO      DEMOMAIN.MAC demo for DANCAD3D v2.x release version, SECOND ANIMATION.
  278. ECHO -
  279. ECHO     The next part of this demo shows how you can animate a 2D projection of the
  280. ECHO moving  gears  by  altering  the  arguments  to  the DISPLAY command.  These 2D
  281. ECHO projections are useful to check the range of motion of parts to  make sure they
  282. ECHO are going to fit together correctly.
  283. ECHO -
  284. ECHO Press [Return] then [Control] & [X] if you want to abort the demo.
  285.  
  286. LOCATE 1 25 ECHO Press [Return] to continue the demo. %%
  287.  
  288.  
  289. WAIT_FOR_RETURN
  290.  
  291. TEXT LOCATE 20 12 ECHO <WORKING: Animating the 2D projection> %%
  292.  
  293. DELAY 1000 ; to give time to press ^X
  294.  
  295. NAME 1 = PIX\DEMOFR-B 0
  296.  
  297. LET FRAMES = 1
  298. :SECOND_ANIMATION
  299. GRAPH_MODE B&W
  300.  
  301. # 1 Display 0 -0  0 -1E18 1.4 1 50 0
  302. # 2 Display 0 -0  0 -1E18 1.4 1 50 0
  303. # 4 Display 0  0  0 -1E18 1   1 -25 25
  304.  
  305. SAVE PIXEL NAME 1 NEXT
  306.  
  307. LOCATE 2 2 OUTPUT FRAMES ECHO  frames down, %%
  308. OUTPUT [ 20 - FRAMES ]   ECHO  to go.
  309. LET FRAMES = [ FRAMES + 1 ]
  310.  
  311. # 1 ROTATE C 0 0  2.25
  312. # 2 ROTATE C 0 0 -1.125
  313. LOOP :SECOND_ANIMATION 19
  314.  
  315. RELEASE FRAMES
  316.  
  317. BEEP ; so you can know when it is done
  318. LOCATE 2 2 ECHO Press [Return] to start.
  319. WAIT
  320.  
  321. LET FRAMES = 20 ; pass number of frames to DEMO-SUB.MAC
  322. LET FNAME  =  2 ; pass ordinal value for frame set name
  323.  
  324. RUN DEMO-SUB.MAC ; call subroutine
  325.  
  326. RELEASE FRAMES ; clean up disk space
  327. RELEASE FNAME
  328.  
  329. ; End Show Gears in close up of Pair Moving
  330.  
  331.  
  332.  
  333. ; Begin Show Gears in close up of Pair Moving
  334.  
  335. TEXT_MODE
  336.  
  337. ECHO      DEMOMAIN.MAC demo for DANCAD3D v2.x release version, THIRD ANIMATION.
  338. ECHO -
  339. ECHO     This demo shows that you can combine changes in perspective while parts are
  340. ECHO animated to give an impression of  looking  around  a  simulated  mechanism  in
  341. ECHO operation.
  342. ECHO     This  animation  makes  200  frames,  so  you  will need some space on your
  343. ECHO harddisk for them to be stored, the requirements are:
  344. ECHO -
  345. ECHO * CGA board, needs 3.3M harddisk bytes free,
  346. ECHO * EGA board, needs 5.7M harddisk bytes free, and
  347. ECHO * Hercules (tm) card needs, harddisk 6.6M bytes free.
  348. ECHO -
  349. ECHO     The two gears will rotate,  along a line passing through their  centers  of
  350. ECHO rotation,  360  degrees  while  10  teeth mesh as they turn at their 2:1 ratio.
  351. ECHO -
  352. ECHO     You  can  film this with any single frame cine camera to view the animation
  353. ECHO at higher speeds.  Saving the images on cine film or stop motion VCR frees  you
  354. ECHO from  the  limits of your harddisk's storage space and lack of speed.  DANMOVIE
  355. ECHO v2.x can be used for tests if you save every tenth or hundredth frame to get  a
  356. ECHO quick idea of how the final result will look.
  357. ECHO -
  358. ECHO Press [Return] then [Control] & [X] if you want to abort the demo.
  359.  
  360. LOCATE 1 25 ECHO Press [Return] to continue the demo. %%
  361.  
  362. WAIT_FOR_RETURN_TO_BE_PRESSED
  363.  
  364. TEXT LOCATE 19 12 ECHO <WORKING: Animating the Compound Motion> %%
  365.  
  366. DELAY 1000 ; to give time to press ^X
  367.  
  368. NAME 1 = PIX\DEMOFR-C 0
  369.  
  370. LET FRAMES = 1
  371. LET XROT   = 0
  372.  
  373. :THIRD_ANIMATION
  374. GRAPH_MODE B&W
  375.  
  376. # 1 COPY # 5 ROTATE Z XROT 0 0
  377. # 2 COPY # 6 ROTATE Z XROT 0 0
  378.  
  379. # 5 Display 0 -18 0 -4000 .85 1 -320 0
  380. # 6 Display 0 -18 0 -4000 .85 1 -320 0
  381. # 3 Display 0  0  0  -1E18  1  1    0 0
  382. # 4 Display 0  0  0  -1E18  1  1    0 0
  383.  
  384. # 6 ERASE
  385. # 5 ERASE
  386.  
  387. SAVE PIXEL NAME 1 NEXT
  388.  
  389. LOCATE 2 2 OUTPUT FRAMES ECHO  frames down, %%
  390. OUTPUT [ 200 - FRAMES ]  ECHO  to go.
  391.  
  392. LET FRAMES = [ FRAMES + 1 ]
  393. LET XROT   = [ XROT + 1.8 ]
  394. # 1 ROTATE C 0 0  2.25
  395. # 2 ROTATE C 0 0 -1.125
  396.  
  397. LOOP :THIRD_ANIMATION 199
  398.  
  399. RELEASE FRAMES
  400.  
  401. BEEP ; so you can know when it is done
  402. LOCATE 2 2 ECHO Press [Return] to start.
  403. WAIT
  404.  
  405. LET FRAMES = 200 ; pass number of frames to DEMO-SUB.MAC
  406. LET FNAME  =   3 ; pass ordinal value for frame set name
  407.  
  408. RUN DEMO-SUB.MAC ; call subroutine
  409.  
  410. RELEASE FRAMES   ; clean up disk space
  411. RELEASE FNAME
  412.  
  413. ; End Show Gears in close up of Pair Moving
  414.  
  415. ; Start Final words
  416.  
  417. TEXT
  418.  
  419. ECHO     Well that's all for this demo.  The gears are still in the workspace so you
  420. ECHO can work with them if you wish.  Press [Return] to exit to the main  menu  then
  421. ECHO press  [D]  to  go  into  the  drawing editor.  Press [Return] when asked which
  422. ECHO elements to display, then pick the [F]ront view to display.  Press [D] to enter
  423. ECHO the drawing sub-menu then press the [+] key to zoom in.  Move the  zoom  border
  424. ECHO around  with your mouse-trackball or cursor keys,  then press the [*/PrtSc] key
  425. ECHO to redraw the screen.  Play with the zoom for a while by using [+] to  zoom  in
  426. ECHO and  [-]  or  [S]cale  to zoom out.  If you want to make your own drawing press
  427. ECHO [Return] back to the drawing root menu then press [I] (initialize) to clear the
  428. ECHO workspace.  Press [T] (tutor) and read the explanation of how to draw lines.
  429.  
  430. WAIT
  431.  
  432. ; End Final Words
  433.  
  434. ; End DEMOMAIN.MAC
  435. 
  436.