home *** CD-ROM | disk | FTP | other *** search
/ M.u.C.S. Disc 2000 / MUCS2000.iso / falcon / 3dx_view / 3dxform.txt next >
Text File  |  1995-04-30  |  6KB  |  163 lines

  1. This file is for programmers that would like to use this file
  2. format, to include them into their programs/demos.
  3. The purpose of this new object format is to provide an optimised
  4. object, for the different displaying modes, with expansion possi-
  5. bilities, and the needed informations for 3d-clipping, animation,
  6. and so on. The comments are preceded by a semi-colon:
  7.  
  8.  
  9. ;Here is the explanation of the different fileds:
  10. ;the length of the fields is given in bytes, in brackets.
  11.  
  12.   "3DX01" + '\0', Null terminated identifier. (6)
  13.   
  14. ;Now we got three different descriptions of the object, depending
  15. ;on the distance viewer-object: there is no point of drawing
  16. ;120 faces that are not bigger than one pixel, because the object
  17. ;is too far away.
  18.  
  19. ;Short range description:
  20.   NOBJS_0    How many objects are there?        (2)
  21.   {  
  22.     NAME,    A null terminated name for the object
  23.              len(name + null char) <= 15        (15)
  24.     NPTS,    How many 3d points are there?      (2)
  25.     NFFCS,   How many faces are there for the shaded faces
  26.              representation?                    (2)
  27.     NWFCS,   How many faces are there for the wireframe
  28.              representation?                    (2)
  29.  
  30. ;The faces can have any number of vertices, they can be triangles,
  31. ;squares,... so we need to know, to know exactly how big the memory
  32. ;allocation should be, how big the sum of the number of vertices of
  33. ;every face is:
  34. ;  if VFi,VWi is the number of vertices of the ith face for the
  35. ;  shaded representation resp. the wireframe representation, then we
  36. ;  need:
  37.     NFOFFS,  = VF1+VF2+...VFn , n=NFFCS        (2)
  38.     NWOFFS,  = VW1+VW2+...VWn , n=NWFCS        (2)
  39.  
  40. ;Boundings of the object:
  41.     XMAX,XMIN,YMAX,YMIN,ZMAX,ZMIN,             (2 each=12)
  42.             
  43. ;Coordinates (=Crd.) of the gravity center of the object:
  44.     [Xg,Yg,Zg],                                (2 each=6)
  45.  
  46. ;Crd. of the three light sources:
  47.     [Xl,Yl,Zl]*3,                              (6*3=18)
  48.  
  49. ;Crd. of the points of the object (points table):
  50.     [X,Y,Z]*NPTS,                              (6*NPTS)
  51.  
  52. ;Description of the shaded faces:
  53.     [
  54.       COL,      coulour of the face            (2)
  55.       NOFFS,    # of vertices in the face      (2)
  56.  
  57. ;Here we have the description of the polygon. the ith OFFSET is the offset
  58. ;in the points table of the ith vertex.
  59. ;!!! Important !!! OFFSET is the offset of the *point* not the
  60. ;offset of the first coordinate:
  61. ; x1,y1,z1 <---- OFFSET == 0
  62. ; x2,y2,z2 <---- OFFSET == 1, and not equal 6 (6 bytes further)!
  63.       (OFFSET)*NFOFFS,                         (2*NFOFFS)
  64.       (Nx,Ny,Nz), Normal vector of the face    (2*3=6)
  65.       (Xg,Yg,Zg), Gravity center of the face   (2*3=6)
  66.     ]*NFFCS,
  67.  
  68. ;Description of the wireframe faces:
  69.     [
  70.       NOFFS,    # of vertices in the face      (2)
  71.       
  72. ;Here we need to know, for each vertex in the face, if there has to be
  73. ;a drawn line from the actual point to the next point in the list.
  74. ;Ex:
  75. ;          1                                 2
  76. ;          *---------------------------------*
  77. ;         /             Face 1                \
  78. ;        /                                     \
  79. ;      4*--This line should only be drawn once--*3
  80. ;      /                                       /
  81. ;     /                 Face 2                /
  82. ;    *---------------------------------------*
  83. ;From point 3 to point 4, there'll be no line for face 1, so here,
  84. ;CONT=0 on point 3. "no line from 3 to 4"
  85. ;Description of Face1:
  86. ;NOFFS==4
  87. ;(OFFSET==1,CONT==1)   means  "line form 1 to 2"
  88. ;(OFFSET==2,CONT==1)          "line from 2 to 3"
  89. ;(OFFSET==3,CONT==0)          "NO line from 3 to 4"
  90. ;(OFFSET==4,CONT==1)          "line from 4 to 1"
  91. ;and every line of Face2 is drawn.
  92. ;Of course, on situations like this:
  93. ;          1                                 2
  94. ;   *-----*---------------------------------*
  95. ;  /Face /             Face 1                \
  96. ; /  3  /                                     \
  97. ;*----4*--This line should only be drawn once--*3
  98. ;     /                                       /
  99. ;    /                 Face 2                /
  100. ;   *---------------------------------------*
  101. ;instead of having "no line from 3 to 4" and "no line from 4 to 1", 
  102. ;the OFFSET 4 will simply not be present, so the face 1 will be:
  103. ;Description of Face1:
  104. ;NOFFS==3
  105. ;(OFFSET==1,CONT==1)   means  "line from 1 to 2"
  106. ;(OFFSET==2,CONT==1)          "line from 2 to 3"
  107. ;(OFFSET==3,CONT==0)          "NO line from 3 to 1"
  108. ;OFFSET has the same meaning as above.
  109. ;and every line of Face2 and Face3 is drawn.
  110. ; ===> every line on the figures above is only drawn once!
  111.     (OFFSET,CONT)*NWOFFS                       (4*NWOFFS)
  112.     ]*NWFCS
  113.  
  114. ;This additional zone is always structured this way (if not empty,
  115. ;that is, its length is 0):
  116.     
  117.     additional zone=
  118.     [
  119.      -LEN          length of additional zone              (4)
  120.      -a 9 BYTES, null terminated string identifier:
  121.       ("BSPTREE" , "MAPTGA" , "GOURAUD", "" if empty...)  (9)
  122.      -LEN bytes    actual description of the zone         (LEN)
  123.      -[additional zone]   ;next additional zone (might be empty)
  124.     ]
  125. ;i.e: an "empty" additional zone would be:
  126. ;LEN==0
  127. ;string identifier==""  (zero string, but don't forget, the zone
  128. ;                        still is 9 bytes long)
  129. ;that would be all
  130. ;if you got for example a BSP tree here:
  131. ;LEN=length of the bsp tree
  132. ;"BSPTREE" (plus the fillers)
  133. ;your bsptree (you choose the sructure
  134. ;now comes the next additional zone, lets say it's empty:
  135. ;LEN==0 .... see above
  136.  
  137.   }*NOBJS_0
  138.   
  139. ;The description of the medium and the long range objects is the same.
  140.   NOBJS_1,
  141.           {...}*NOBJS_1
  142.   NOBJS_2,
  143.           {...}*NOBJS_2
  144.  
  145.  
  146.                                         Nikopol (Flatliner)
  147.  
  148. Ok, that's it. If you have a good idea of an expansion to the format,
  149. please send it to me (with its format). My mail adresses are:
  150.  
  151. email:
  152.   lmuniz@vub.ac.be    on internet
  153. smail:
  154.   Luis Muniz
  155.   564 chaussee de Boondael
  156.   B-1050 Brussels
  157.   Belgium
  158.   
  159.   from august/september on:
  160.   54, rue Dillens
  161.   B-1050 Brussels
  162.   Belgium
  163.