home *** CD-ROM | disk | FTP | other *** search
/ Avalon - 3D Objects & Resources / Avalon.iso / frmtspcs / 3dxform.txt < prev    next >
Text File  |  1995-01-01  |  5KB  |  150 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)
  88. ;(OFFSET==2,CONT==1)
  89. ;(OFFSET==3,CONT==1)
  90. ;(OFFSET==4,CONT==0)
  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)
  106. ;(OFFSET==2,CONT==1)
  107. ;(OFFSET==3,CONT==0)
  108. ;OFFSET has the same meaning as above.
  109. ;and every line of Face2 and Fcae3 is drawn.
  110.     (OFFSET,CONT)*NWOFFS                       (4*NWOFFS)
  111.     ]*NWFCS
  112.  
  113. ;This additional zone is always structured this way (if not empty,
  114. ;that is, its length is 0):
  115.     
  116.     additional zone=
  117.     [
  118.      -LEN          length of additional zone    (4)
  119.      -a 9 BYTES, null terminated string identifier:
  120.       ("BSPTREE" , "MAPTGA" ,"" (if empty)...)  (9)
  121.      -LEN bytes    actual description of the zone
  122.      -[additional zone]   ;next additional zone (might be empty)
  123.     ]
  124.   }*NOBJS_0
  125.   
  126. ;The description of the medium and the long range objects is the same.
  127.   NOBJS_1,
  128.           {...}*NOBJS_1
  129.   NOBJS_2,
  130.           {...}*NOBJS_2
  131.  
  132.  
  133.                                         Nikopol (Flatliner)
  134.  
  135. Ok, that's it. If you have a good idea of an expansion to the format,
  136. please send it to me (with its format). My mail adresses are:
  137.  
  138. email:
  139.   lmuniz@vub.ac.be    on internet
  140. smail:
  141.   Luis Muniz
  142.   564 chaussee de Boondael
  143.   B-1050 Brussels
  144.   Belgium
  145.   
  146.   from august/september on:
  147.   54, rue Dillens
  148.   B-1050 Brussels
  149.   Belgium
  150.