home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / asm / 3dvect25 / objects.inc < prev    next >
Encoding:
Text File  |  1993-07-23  |  14.8 KB  |  486 lines

  1. setupbase:
  2.  
  3.            mov objbase[ 0*16+ 0],offset cube1a
  4.            mov objbase[ 0*16+ 4],offset cube1b
  5.            mov objbase[ 0*16+ 8],offset cube1c
  6.            mov objbase[ 0*16+12],offset cube1d
  7.  
  8.            mov objbase[ 1*16+ 0],offset cube2a
  9.            mov objbase[ 1*16+ 4],offset cube2b
  10.            mov objbase[ 1*16+ 8],offset cube2c
  11.            mov objbase[ 1*16+12],offset cube2d
  12.  
  13.            mov objbase[ 2*16+ 0],offset ringa
  14.            mov objbase[ 2*16+ 4],offset ringb
  15.            mov objbase[ 2*16+ 8],offset ringc
  16.            mov objbase[ 2*16+12],offset ringd
  17.  
  18.            mov objbase[ 3*16+ 0],offset rubinea
  19.            mov objbase[ 3*16+ 4],offset rubineb
  20.            mov objbase[ 3*16+ 8],offset rubinec
  21.            mov objbase[ 3*16+12],offset rubined
  22.  
  23.            mov objbase[ 4*16+ 0],offset diamonda
  24.            mov objbase[ 4*16+ 4],offset diamondb
  25.            mov objbase[ 4*16+ 8],offset diamondc
  26.            mov objbase[ 4*16+12],offset diamondd
  27.  
  28.            mov objbase[ 5*16+ 0],offset cube3a
  29.            mov objbase[ 5*16+ 4],offset cube3b
  30.            mov objbase[ 5*16+ 8],offset cube3c
  31.            mov objbase[ 5*16+12],offset cube3d
  32.  
  33.            ret
  34.  
  35. ; shape data can be almost as large as you need it 'till it crashes. try a cube
  36. ; 20000x20000x20000.  calculations use 32 bit registers and can handle
  37. ; up to 16 bit locations.  keeping the object size small will allow a larger
  38. ; visible space.  but larger objects will allow you to get closer with more
  39. ; accuracy in the mathematics of rotations.
  40. ;
  41. ; list of command bits to date:
  42. ;
  43. ; 00000001 - 1  steel texture for surface 0 = none,  colour  offset  determines
  44. ;               screen offset for texture.  eg 16+7 will use colour block 16-31
  45. ;               but make the sine wave texture 14 (7*2) lines down. this is  so
  46. ;               all sine wave textures do not appear on the same line.
  47. ; 00000010 - 2  side is always visible no matter angle
  48. ; 00000100 - 4  side is always visible but other side has high byte colour
  49. ;               note: if this is used, bits 2 and 6 must NOT be set (+2 or +32)
  50. ; 00001000 - 8  if other side IS used (above), this determines if steel texture
  51. ; 00010000 - 16 if used, defines a line (must be set to define a true line)
  52. ; 00100000 - 32 if set, defines a bitmap,eg: point #, bitmap #, x scale,y scale
  53. ; 01000000 - 64 defines a single point; must be repeated! eg dw 64,col,3,3
  54. ; 10000000 - xx not used, entire high byte also not used (define your own)
  55. ;
  56. ; there are two kinds of bitmaps and points.  those which  are  inside  objects
  57. ; and those which are seperate objects themselvs.  if userotate object  command
  58. ; is set to 32 or 64, then the entire object is considered to be either a point
  59. ; or bitmap.  but if userotate is not set this way, then  a  normal  object  is
  60. ; drawn and bitmaps then come from within the object definitions (below).  this
  61. ; way, bitmaps and points can be either part of a larger object,  or  they  are
  62. ; computed fast on their own. (eg explosions and bullets as  seperate  objects)
  63. ;
  64. ; note: when writing surface descriptions, try to make the  first value unique
  65. ; from any other first value.  this way, the sort routine  will  give  a  more
  66. ; accurate sorting of sides. eg 1,3,6,1  2,4,1,2  rather than 1,3,6,1  1,2,4,1
  67.  
  68.            align 4
  69.  
  70. cube1a:
  71. cube1b:
  72. cube1c:
  73. cube1d     dw 8           ; how many points
  74.            dw 6           ; how many surfaces
  75.            ;    x   y   z
  76.            dw -70, 70, 70 ;0
  77.            dw -70,-70, 70 ;1
  78.            dw  70,-70, 70 ;2
  79.            dw  70, 70, 70 ;3
  80.            dw -70, 70,-70 ;4
  81.            dw -70,-70,-70 ;5
  82.            dw  70,-70,-70 ;6
  83.            dw  70, 70,-70 ;7
  84.  
  85.            dw 1,16*3+8  ,0,1,2,3,0 ; surface connection data, and colours
  86.            dw 0,16*2+4  ,7,6,5,4,7 ; end point=start point means done side
  87.            dw 0,16*1+15 ,3,2,6,7,3
  88.            dw 1,16*2+12 ,4,5,1,0,4
  89.            dw 0,16*3+0  ,4,0,3,7,4
  90.            dw 1,16*4+10 ,1,5,6,2,1
  91.  
  92. cube2a:
  93. cube2b:
  94. cube2c:
  95. cube2d     dw 8           ; how many points
  96.            dw 9           ; how many surfaces
  97.            ;    x   y   z
  98.            dw -70, 70, 70 ;0
  99.            dw -70,-70, 70 ;1
  100.            dw  70,-70, 70 ;2
  101.            dw  70, 70, 70 ;3
  102.            dw -70, 70,-70 ;4
  103.            dw -70,-70,-70 ;5
  104.            dw  70,-70,-70 ;6
  105.            dw  70, 70,-70 ;7
  106.  
  107.            dw 4+8, 16*3+8+(16*1+1)*256, 0,1,2,3,0 ; surface connection data, and colours
  108.            dw 16,16*2+4  ,5,1,5   ; end point=start point means done side
  109.            dw 16,16*1+15 ,6,2,6
  110.            dw 16,16*2+12 ,7,3,7
  111.            dw 16,16*3+0  ,4,0,4
  112.            dw 16,16*4+10 ,5,6,5
  113.            dw 16,16*4+10 ,6,7,6
  114.            dw 16,16*4+10 ,7,4,7
  115.            dw 16,16*4+10 ,4,5,4
  116.  
  117. cube3a:
  118. cube3b     dw 45          ; how many points
  119.            dw 45          ; how many surfaces
  120.            ;    x   y   z
  121.            dw -70, 70, 70 ;0
  122.            dw -70, 70, 35 ;1
  123.            dw -70, 70,  0 ;2
  124.            dw -70, 70,-35 ;3
  125.  
  126.            dw -70,-70, 70 ;4
  127.            dw -70,-70, 35 ;5
  128.            dw -70,-70,  0 ;6
  129.            dw -70,-70,-35 ;7
  130.  
  131.            dw  70,-70, 70 ;8
  132.            dw  70,-70, 35 ;9
  133.            dw  70,-70,  0 ;10
  134.            dw  70,-70,-35 ;11
  135.  
  136.            dw  70, 70, 70 ;12
  137.            dw  70, 70, 35 ;13
  138.            dw  70, 70,  0 ;14
  139.            dw  70, 70,-35 ;15
  140.  
  141.            dw -70, 70,-70 ;16
  142.            dw -70, 35,-70 ;17
  143.            dw -70,  0,-70 ;18
  144.            dw -70,-35,-70 ;19
  145.            dw -70,-70,-70 ;20
  146.  
  147.            dw  70, 70,-70 ;21
  148.            dw  70, 35,-70 ;22
  149.            dw  70,  0,-70 ;23
  150.            dw  70,-35,-70 ;24
  151.            dw  70,-70,-70 ;25
  152.  
  153.            dw -70, 35, 70 ;26
  154.            dw -70,  0, 70 ;27
  155.            dw -70,-35, 70 ;28
  156.  
  157.            dw  70, 35, 70 ;29
  158.            dw  70,  0, 70 ;30
  159.            dw  70,-35, 70 ;31
  160.  
  161.            dw -35,-70, 70 ;32
  162.            dw   0,-70, 70 ;33
  163.            dw  35,-70, 70 ;34
  164.  
  165.            dw -35,-70,-70 ;35
  166.            dw   0,-70,-70 ;36
  167.            dw  35,-70,-70 ;37
  168.  
  169.            dw -35, 70,-70 ;38
  170.            dw   0, 70,-70 ;39
  171.            dw  35, 70,-70 ;40
  172.  
  173.            dw -35, 70, 70 ;41
  174.            dw   0, 70, 70 ;42
  175.            dw  35, 70, 70 ;43
  176.  
  177.            dw   0,0,0 ; 44
  178.  
  179.            dw 32,00,0,5,5
  180.            dw 32,01,0,5,5
  181.            dw 32,02,0,5,5
  182.            dw 32,03,0,5,5
  183.            dw 32,04,0,5,5
  184.            dw 32,05,0,5,5
  185.            dw 32,06,0,5,5
  186.            dw 32,07,0,5,5
  187.            dw 32,08,0,5,5
  188.            dw 32,09,0,5,5
  189.            dw 32,10,0,5,5
  190.            dw 32,11,0,5,5
  191.            dw 32,12,0,5,5
  192.            dw 32,13,0,5,5
  193.            dw 32,14,0,5,5
  194.            dw 32,15,0,5,5
  195.            dw 32,16,0,5,5
  196.            dw 32,17,0,5,5
  197.            dw 32,18,0,5,5
  198.            dw 32,19,0,5,5
  199.            dw 32,20,0,5,5
  200.            dw 32,21,0,5,5
  201.            dw 32,22,0,5,5
  202.            dw 32,23,0,5,5
  203.            dw 32,24,0,5,5
  204.            dw 32,25,0,5,5
  205.            dw 32,26,0,5,5
  206.            dw 32,27,0,5,5
  207.            dw 32,28,0,5,5
  208.            dw 32,29,0,5,5
  209.            dw 32,30,0,5,5
  210.            dw 32,31,0,5,5
  211.            dw 32,32,0,5,5
  212.            dw 32,33,0,5,5
  213.            dw 32,34,0,5,5
  214.            dw 32,35,0,5,5
  215.            dw 32,36,0,5,5
  216.            dw 32,37,0,5,5
  217.            dw 32,38,0,5,5
  218.            dw 32,39,0,5,5
  219.            dw 32,40,0,5,5
  220.            dw 32,41,0,5,5
  221.            dw 32,42,0,5,5
  222.            dw 32,43,0,5,5
  223.  
  224.            dw 32,44,0,30,30
  225.  
  226. cube3c:
  227. cube3d     dw 45  ; this is same as above but since bitmaps can't be seen
  228.            dw 45  ; from far, i use the same cube with points instead.
  229.            ;    x   y   z
  230.            dw -70, 70, 70 ;0  ; this is an example of how to use the
  231.            dw -70, 70, 35 ;1  ; different resolutions based on distance
  232.            dw -70, 70,  0 ;2  ; you could get rid of half of these points
  233.            dw -70, 70,-35 ;3  ; and still have it "look" the same because
  234.  
  235.            dw -70,-70, 70 ;4  ; of the great distance at which this will
  236.            dw -70,-70, 35 ;5  ; be seen
  237.            dw -70,-70,  0 ;6
  238.            dw -70,-70,-35 ;7
  239.  
  240.            dw  70,-70, 70 ;8
  241.            dw  70,-70, 35 ;9
  242.            dw  70,-70,  0 ;10
  243.            dw  70,-70,-35 ;11
  244.  
  245.            dw  70, 70, 70 ;12
  246.            dw  70, 70, 35 ;13
  247.            dw  70, 70,  0 ;14
  248.            dw  70, 70,-35 ;15
  249.  
  250.            dw -70, 70,-70 ;16
  251.            dw -70, 35,-70 ;17
  252.            dw -70,  0,-70 ;18
  253.            dw -70,-35,-70 ;19
  254.            dw -70,-70,-70 ;20
  255.  
  256.            dw  70, 70,-70 ;21
  257.            dw  70, 35,-70 ;22
  258.            dw  70,  0,-70 ;23
  259.            dw  70,-35,-70 ;24
  260.            dw  70,-70,-70 ;25
  261.  
  262.            dw -70, 35, 70 ;26
  263.            dw -70,  0, 70 ;27
  264.            dw -70,-35, 70 ;28
  265.  
  266.            dw  70, 35, 70 ;29
  267.            dw  70,  0, 70 ;30
  268.            dw  70,-35, 70 ;31
  269.  
  270.            dw -35,-70, 70 ;32
  271.            dw   0,-70, 70 ;33
  272.            dw  35,-70, 70 ;34
  273.  
  274.            dw -35,-70,-70 ;35
  275.            dw   0,-70,-70 ;36
  276.            dw  35,-70,-70 ;37
  277.  
  278.            dw -35, 70,-70 ;38
  279.            dw   0, 70,-70 ;39
  280.            dw  35, 70,-70 ;40
  281.  
  282.            dw -35, 70, 70 ;41
  283.            dw   0, 70, 70 ;42
  284.            dw  35, 70, 70 ;43
  285.  
  286.            dw   0,0,0 ; 44
  287.  
  288.            dw 64,28,00,00
  289.            dw 64,28,01,01
  290.            dw 64,28,02,02
  291.            dw 64,28,03,03
  292.            dw 64,28,04,04
  293.            dw 64,28,05,05
  294.            dw 64,28,06,06
  295.            dw 64,28,07,07
  296.            dw 64,28,08,08
  297.            dw 64,28,09,09
  298.            dw 64,28,10,10
  299.            dw 64,28,11,11
  300.            dw 64,28,12,12
  301.            dw 64,28,13,13
  302.            dw 64,28,14,14
  303.            dw 64,28,15,15
  304.            dw 64,28,16,16
  305.            dw 64,28,17,17
  306.            dw 64,28,18,18
  307.            dw 64,28,19,19
  308.            dw 64,28,20,20
  309.            dw 64,28,21,21
  310.            dw 64,28,22,22
  311.            dw 64,28,23,23
  312.            dw 64,28,24,24
  313.            dw 64,28,25,25
  314.            dw 64,28,26,26
  315.            dw 64,28,27,27
  316.            dw 64,28,28,28
  317.            dw 64,28,29,29
  318.            dw 64,28,30,30
  319.            dw 64,28,31,31
  320.            dw 64,28,32,32
  321.            dw 64,28,33,33
  322.            dw 64,28,34,34
  323.            dw 64,28,35,35
  324.            dw 64,28,36,36
  325.            dw 64,28,37,37
  326.            dw 64,28,38,38
  327.            dw 64,28,39,39
  328.            dw 64,28,40,40
  329.            dw 64,28,41,41
  330.            dw 64,28,42,42
  331.            dw 64,28,43,43
  332.  
  333.            dw 64,28,44,44
  334.  
  335. ringa:
  336. ringb:
  337. ringc:
  338. ringd      dw 32
  339.            dw 32
  340.            ;    x   y   z
  341.            dw -40, 80, 30 ; 0
  342.            dw -80, 40, 30 ; 1
  343.            dw -80,-40, 30 ; 2
  344.            dw -40,-80, 30 ; 3
  345.            dw  40,-80, 30 ; 4
  346.            dw  80,-40, 30 ; 5
  347.            dw  80, 40, 30 ; 6
  348.            dw  40, 80, 30 ; 7
  349.            dw -40, 20, 45 ; 8
  350.            dw -40,-20, 45 ; 9
  351.            dw -20,-40, 45 ;10
  352.            dw  20,-40, 45 ;11
  353.            dw  40,-20, 45 ;12
  354.            dw  40, 20, 45 ;13
  355.            dw  20, 40, 45 ;14
  356.            dw -20, 40, 45 ;15
  357.            dw -40, 80,-30 ;16
  358.            dw -80, 40,-30 ;17
  359.            dw -80,-40,-30 ;18
  360.            dw -40,-80,-30 ;19
  361.            dw  40,-80,-30 ;20
  362.            dw  80,-40,-30 ;21
  363.            dw  80, 40,-30 ;22
  364.            dw  40, 80,-30 ;23
  365.            dw -40, 20,-45 ;24
  366.            dw -40,-20,-45 ;25
  367.            dw -20,-40,-45 ;26
  368.            dw  20,-40,-45 ;27
  369.            dw  40,-20,-45 ;28
  370.            dw  40, 20,-45 ;29
  371.            dw  20, 40,-45 ;30
  372.            dw -20, 40,-45 ;31
  373.  
  374.            dw 0,16+7  ,1,8,15,0,1
  375.            dw 0,16+9  ,2,9,8,1,2
  376.            dw 0,16+5  ,3,10,9,2,3
  377.            dw 0,16+3  ,4,11,10,3,4
  378.            dw 0,16+6  ,5,12,11,4,5
  379.            dw 0,16+9  ,6,13,12,5,6
  380.            dw 0,16+7  ,7,14,13,6,7
  381.            dw 0,16+11 ,0,15,14,7,0
  382.            dw 0,16+7  ,0,16,17,1,0
  383.            dw 0,16+6  ,1,17,18,2,1
  384.            dw 0,16+5  ,2,18,19,3,2
  385.            dw 0,16+4  ,3,19,20,4,3
  386.            dw 0,16+13 ,4,20,21,5,4
  387.            dw 0,16+1  ,5,21,22,6,5
  388.            dw 0,16+15 ,6,22,23,7,6
  389.            dw 0,16+14 ,7,23,16,0,7
  390.            dw 0,16+9  ,9,25,24,8,9
  391.            dw 0,16+13 ,10,26,25,9, 10
  392.            dw 0,16+12 ,11,27,26,10,11
  393.            dw 0,16+10 ,12,28,27,11,12
  394.            dw 0,16+6  ,13,29,28,12,13
  395.            dw 0,16+7  ,14,30,29,13,14
  396.            dw 0,16+8  ,14,15,31,30,14
  397.            dw 0,16+5  ,31,15,8,24,31
  398.            dw 0,16+6  ,17,24,25,18,17
  399.            dw 0,16+9  ,18,25,26,19,18
  400.            dw 0,16+8  ,19,26,27,20,19
  401.            dw 0,16+7  ,20,27,28,21,20
  402.            dw 0,16+8  ,21,28,29,22,21
  403.            dw 0,16+12 ,22,29,30,23,22
  404.            dw 0,16+15 ,23,30,31,16,23
  405.            dw 0,16+7  ,16,31,24,17,16
  406.  
  407. diamonda:
  408. diamondb:
  409. diamondc:
  410. diamondd   dw 13
  411.            dw 17
  412.  
  413.            dw -100,  50,   0
  414.            dw -100, -50,   0
  415.            dw  -50,-100,   0
  416.            dw   50,-100,   0
  417.            dw  100, -50,   0
  418.            dw  100,  50,   0
  419.            dw   50, 100,   0
  420.            dw  -50, 100,   0
  421.            dw  -50,  50,  40
  422.            dw  -50, -50,  40
  423.            dw   50, -50,  40
  424.            dw   50,  50,  40
  425.            dw    0,   0,-120
  426.  
  427.            dw 0,32+7     ,0,1,9,8,0
  428.            dw 0,32+9     ,9,2,3,10,9
  429.            dw 0,32+5     ,11,10,4,5,11
  430.            dw 0,32+3     ,7,8,11,6,7
  431.            dw 0,32+6     ,1,2,9,1
  432.            dw 0,32+9     ,10,3,4,10
  433.            dw 0,32+7     ,6,11,5,6
  434.            dw 0,32+11    ,0,8,7,0
  435.            dw 0,32+7     ,8,9,10,11,8
  436.            dw 0,32+6     ,7,12,0,7
  437.            dw 0,32+5     ,0,12,1,0
  438.            dw 0,32+4     ,1,12,2,1
  439.            dw 0,32+13    ,2,12,3,2
  440.            dw 0,32+1     ,3,12,4,3
  441.            dw 0,32+15    ,4,12,5,4
  442.            dw 0,32+14    ,5,12,6,5
  443.            dw 0,32+9     ,6,12,7,6
  444.  
  445. rubinea:
  446. rubineb:
  447. rubinec:
  448. rubined    dw 16
  449.            dw 18
  450.  
  451.            dw -100,  50,   0
  452.            dw -100, -50,   0
  453.            dw  -50,-100,   0
  454.            dw   50,-100,   0
  455.            dw  100, -50,   0
  456.            dw  100,  50,   0
  457.            dw   50, 100,   0
  458.            dw  -50, 100,   0
  459.            dw  -50,  50,  40
  460.            dw  -50, -50,  40
  461.            dw   50, -50,  40
  462.            dw   50,  50,  40
  463.            dw  -50,  50, -40
  464.            dw  -50, -50, -40
  465.            dw   50, -50, -40
  466.            dw   50,  50, -40
  467.  
  468.            dw 1,32+7    ,0,1,9,8,0
  469.            dw 0,32+9    ,9,2,3,10,9
  470.            dw 1,32+11   ,11,10,4,5,11
  471.            dw 0,32+3    ,7,8,11,6,7
  472.            dw 1,32+4    ,1,2,9,1
  473.            dw 0,32+9    ,10,3,4,10
  474.            dw 1,32+8    ,6,11,5,6
  475.            dw 0,32+11   ,0,8,7,0
  476.            dw 1,32+3    ,8,9,10,11,8
  477.            dw 0,32+6    ,5,4,14,15,5
  478.            dw 1,32+5    ,14,3,2,13,14
  479.            dw 0,32+4    ,12,13,1,0,12
  480.            dw 1,32+12   ,6,15,12,7,6
  481.            dw 0,32+1    ,4,3,14,4
  482.            dw 1,32+15   ,13,2,1,13
  483.            dw 0,32+14   ,7,12,0,7
  484.            dw 1,32+9    ,5,15,6,5
  485.            dw 0,32+13   ,15,14,13,12,15
  486.