home *** CD-ROM | disk | FTP | other *** search
/ Fujiology Archive / fujiology_archive_v1_0.iso / !FALCON / LINEOUT / OUT.ZIP / SOURCE.ZIP / OBJECT3D.I < prev    next >
Text File  |  2002-07-26  |  3KB  |  107 lines

  1. ; 3d object library.
  2. ; Designed for u-fly engine.
  3. ; Custom objects + generators.
  4.  
  5. ; INPUT:
  6. ; d0.l=size
  7. ; a0: dst
  8. ; a1: src
  9. Object3d.copy:
  10.     lsr.l    d0
  11.     beq.s    .end
  12.     subq.w    #1,d0
  13. .loop:    move.w    (a1)+,(a0)+
  14.     dbf    d0,.loop
  15. .end:    rts
  16.  
  17. ; INPUT:
  18. ; d0.w=start vertex
  19. ; d1.w=#vertices
  20. ; d2.w=scalar (8:8)
  21. ; a0: object
  22. Object3d.scale:
  23.     mulu.w    #Vertex.SIZE,d0
  24.     lea    4(a0,d0.l),a0
  25.     mulu.w    #Vertex.SIZE/2,d1
  26.     subq.w    #1,d1
  27.     bmi.s    .end
  28. .loop:    move.w    (a0),d0
  29.     muls.w    d2,d0
  30.     asr.l    #8,d0
  31.     move.w    d0,(a0)+
  32.     dbf    d1,.loop
  33. .end:    rts
  34.  
  35.     DATA
  36.  
  37. Object3d.spikey:
  38.     DC.W    (.end-.start)/Vertex.SIZE    * amount of vertices
  39.     DC.W    (.end-.normstart)/Vertex.SIZE    * amount of normals
  40. .start:    DC.W    -250,-250,-250
  41.     DC.W    -250,250,-250
  42.     DC.W    250,-250,-250
  43.     DC.W    250,250,-250
  44.     DC.W    -250,-250,250
  45.     DC.W    -250,250,250
  46.     DC.W    250,-250,250
  47.     DC.W    250,250,250
  48.     DC.W    -800,0,0
  49.     DC.W    +800,0,0
  50.     DC.W    0,-800,0
  51.     DC.W    0,+800,0
  52.     DC.W    0,0,-800
  53.     DC.W    0,0,+800
  54. .normstart:
  55.     DC.W    -73,-73,-73
  56.     DC.W    -73,73,-73
  57.     DC.W    73,-73,-73
  58.     DC.W    73,73,-73
  59.     DC.W    -73,-73,73
  60.     DC.W    -73,73,73
  61.     DC.W    73,-73,73
  62.     DC.W    73,73,73
  63.     DC.W    -40,0,0
  64.     DC.W    +40,0,0
  65.     DC.W    0,-40,0
  66.     DC.W    0,+40,0
  67.     DC.W    0,0,-40
  68.     DC.W    0,0,+40
  69. .end:
  70.  
  71.     DC.W    (.end2d-.start2d)/Vertex2d.SIZE    * amount of 2d vertices
  72. .start2d:
  73. .end2d:
  74.  
  75.     DC.W    24                * amount of primitives
  76.  
  77.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+0,1,12,+14,15,26
  78.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+3,2,12,+17,16,26
  79.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+1,3,12,+15,17,26
  80.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+2,0,12,+16,14,26
  81.  
  82.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+5,4,13,+19,18,27
  83.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+6,7,13,+20,21,27
  84.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+7,5,13,+21,19,27
  85.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+4,6,13,+18,20,27
  86.  
  87.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+0,4,8,+14,18,22
  88.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+5,1,8,+19,15,22
  89.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+1,0,8,+15,14,22
  90.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+4,5,8,+18,19,22
  91.  
  92.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+6,2,9,+20,16,23
  93.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+3,7,9,+17,21,23
  94.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+2,3,9,+16,17,23
  95.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+7,6,9,+21,20,23
  96.  
  97.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+0,2,10,+14,16,24
  98.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+6,4,10,+20,18,24
  99.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+4,0,10,+18,14,24
  100.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+2,6,10,+16,20,24
  101.  
  102.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+3,1,11,+17,15,25
  103.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+5,7,11,+19,21,25
  104.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+1,5,11,+15,19,25
  105.     DC.W    Polygon.TRI|Polygon.ENVMAPPED|0,+7,3,11,+21,17,25
  106. Object3d.spikeyEnd:
  107.