home *** CD-ROM | disk | FTP | other *** search
/ Avalon - 3D Objects & Resources / Avalon.iso / frmtspcs / 3ds_fmt.txt < prev    next >
Internet Message Format  |  1995-01-01  |  13KB

  1. From owner-majordomo@autodesk.com Fri Dec 23 03:22 EST 1994
  2. Received: from eye.com by hemlock with SMTP
  3.     (1.37.109.8/15.6) id AA27990; Fri, 23 Dec 1994 03:22:25 -0500
  4. Return-Path: <owner-majordomo@autodesk.com>
  5. Received: from adeskgate.autodesk.com by eye.com with SMTP
  6.     (1.36.108.4/16.2) id AA05686; Fri, 23 Dec 1994 03:21:56 -0500
  7. Received: from autodesk.autodesk.com by adeskgate.autodesk.com (8.6.8/4.4BSD) with ESMTP id AAA16999; Fri, 23 Dec 1994 00:03:42 -0800
  8. Received: from meep.autodesk.com by autodesk.autodesk.com (8.6.8/4.4BSD) with SMTP id AAA00869; Fri, 23 Dec 1994 00:05:14 -0800
  9. Received: from autodesk.autodesk.com by meep.autodesk.com (4.1/SMI-4.1)
  10.     id AA24806; Fri, 23 Dec 94 00:03:10 PST
  11. Received: from adeskgate.autodesk.com by autodesk.autodesk.com (8.6.8/4.4BSD) with ESMTP id AAA00773; Fri, 23 Dec 1994 00:03:55 -0800
  12. Received: from tyrell.net by adeskgate.autodesk.com (8.6.8/4.4BSD) with SMTP id AAA16912; Fri, 23 Dec 1994 00:02:15 -0800
  13. Received: by tyrell.net id AA08226
  14.   (5.65c/IDA-1.4.4 for 3dstudio@autodesk.com); Fri, 23 Dec 1994 02:01:08 -0600
  15. Date: Fri, 23 Dec 1994 02:01:08 -0600
  16. From: Jim Lammers <trinity@tyrell.net>
  17. Message-Id: <199412230801.AA08226@tyrell.net>
  18. To: 3dstudio@autodesk.com
  19. Subject: 3D Studio file format described
  20. Status: RO
  21.  
  22.  
  23. Here's something I saw on alt.3d I thought you'd all be interested in:
  24. ------------------------------
  25.  
  26.                   3D Studio File Format  (3ds).
  27.                          Autodesk Ltd.
  28.  
  29.  
  30. Document Revision 0.8 -  December 1994.  First Public Release.
  31.  
  32. If you have any additions or comments to this file please e-mail me.
  33.  
  34. A lot of the chunks are still undocumented if you know what they
  35. do please email me.  As I get more information of the file format
  36. I will document it for everyone to see.  I will post this regularly
  37. to alt.3d and I can be contacted there if my email does not work.
  38.  
  39. Disclaimer.
  40. This document describes the file format of the 3ds files of 3D studio 
  41. by Autodesk.  By using the information contained within you agree not 
  42. to hold me liable if, from its use, you f^Hmuck something up. OK?  
  43.  
  44. Oh and just to make it clear I DO NOT work for Autodesk if you have
  45. any problems with their programs direct it to them not me!
  46.  
  47. Get to it!
  48.  
  49. Now with the joviality's aside all this info I have obtained with
  50. lots of work hacking at 3ds files with a diskeditor and diff.
  51. It has taken many months of hard work and piddling around with them 
  52. so I hope that it is appreciated.
  53.  
  54. Remember information wants to be free!
  55.  
  56. *  Jim Pitts.  -  18 December 1994
  57.  
  58. Contact me at jp5@ukc.ac.uk
  59.  
  60. 1.
  61.  
  62.   The 3ds file format is made up of chunks.  They describe what information 
  63.   is to follow and what it is made up of, its ID and the location of 
  64.   the next main block.  If you don't understand a chuck you can quite simply
  65.   skip it.  The next chunk pointer is relative to the start of the current 
  66.   chunk and in bytes.
  67.  
  68.   * A Chunk.
  69.  
  70.   start end  size  name
  71.   0     1    2     Chunk ID
  72.   2     5    4     Next Chunk
  73.  
  74.   Chunks have a hierarchy imposed on them that is identified by its ID.
  75.   A 3ds file has the Primary chunk ID 4D4Dh.  This is always the first chunk 
  76.   of the file.  With in the primary chunk are the main chunks.
  77.  
  78.   * Main Chunks
  79.  
  80.    id           Description
  81.  
  82.   3D3D          Start of object mesh data.
  83.   B000          Start of keyframer data.
  84.  
  85.   The Next Chunk pointer after the ID block points to the next Main chunk.
  86.  
  87.   Directly after a Main chunk is another chunk.  This could be any other
  88.   type of chunk allowable within its main chunks scope.
  89.  
  90.   For the Mesh description (3D3D) they could be any multiples of.
  91.  
  92.   * Subchunks of 3D3D. - Mesh Block
  93.  
  94.     id          Description
  95.    1100         unknown
  96.    1200         Background Colour.
  97.    1201         unknown
  98.    1300         unknown
  99.    1400         unknown
  100.    1420         unknown
  101.    1450         unknown
  102.    1500         unknown
  103.    2100         Ambient Colour Block
  104.    2200         fog?
  105.    2201         fog?
  106.    2210         fog?
  107.    2300         unknown
  108.    3000         unknown
  109.    4000         Object Block
  110.    7001         unknown
  111.    AFFF         unknown
  112.  
  113.    * Subchunks of 4000  - Object Description Block
  114.  
  115.    - first item of Subchunk 4000 is an ASCIIZ string of the objects name.
  116.  
  117.    Remember an object can be a mesh, a light or a camera.
  118.  
  119.     id          Description
  120.    4010         unknown
  121.    4012         shadow?
  122.    4100         Triangular Polygon Object
  123.    4600         Light
  124.    4700         Camera
  125.  
  126.  
  127.    * Subchunks of 4100 - Triangular Polygon Object
  128.  
  129.     id          Description
  130.    4110         Vertex List
  131.    4111         unknown
  132.    4120         Points List
  133.    4160         Translation Matrix
  134.  
  135.    * 4110 - Vertex List
  136.  
  137.    start end  size  type        name  
  138.     0     1    2    short int   Total vertices in object    
  139.  
  140.     2     5    4    float       X value
  141.     6     9    4    float       Y value
  142.    10    13    4    float       Z value
  143.    ..    ..    .     ..           ..
  144.    ..    ..    .     ..           ..
  145.  
  146.    bytes 2 .. 13 are repeated [Total vertices in object] times for 
  147.    each vertex.
  148.  
  149.    
  150.    * 4111 - unknown
  151.  
  152.    start end  size  type        name  
  153.     0     1    2    short int   Total vertices in object ?
  154.     
  155.     2     3    2    short int   unknown
  156.     .     .    .      ..          ..
  157.     .     .    .      ..          ..
  158.  
  159.     bytes 2..3 are repeated for X times as described by 
  160.     short int at start of record.
  161.  
  162.    
  163.    * 4120 - Points List
  164.  
  165.    start end  size  type        name  
  166.     0     1    2    short int   Total polygons in object - numpoly
  167.  
  168.     2     3    2    short int   Point 1
  169.     4     5    2    short int   Point 2
  170.     6     7    2    short int   Point 3
  171.     .     .    .     ..           ..
  172.     .     .    .     ..           ..
  173.  
  174.     Repeats 'numpoly' times for each polygon.
  175.     
  176.     
  177.     These points refer to the corresponding vertex of 
  178.     the triangular polygon from the vertex list.  
  179.     Points are organized in a clock-wise order.
  180.  
  181.  
  182.    * 4160 - Translation Matrix
  183.  
  184.     This structure describes a matrix for the object.
  185.     It is stored as a 3 X 4 matrix because it is assumed that
  186.     the right most column is 0,0,0,1 
  187.  
  188.    start end  size  type        name  
  189.     0     3    4    float       matrix 1,1
  190.     4     7    4    float       matrix 1,2
  191.     8    11    4    float       matrix 1,3
  192.    12    15    4    float       matrix 2,1
  193.    16    19    4    float       matrix 2,2
  194.    20    23    4    float       matrix 2,3
  195.    24    27    4    float       matrix 3,1
  196.    28    31    4    float       matrix 3,2
  197.    32    35    4    float       matrix 3,3
  198.    36    39    4    float       matrix 4,1
  199.    40    43    4    float       matrix 4,2
  200.    44    47    4    float       matrix 4,3
  201.  
  202.  
  203.    * 4600  - Light
  204.  
  205.  
  206.    start end  size  type        name  
  207.     0     3    4    float       Light pos X
  208.     4     7    4    float       Light pos Y
  209.     8    11    4    float       Light pos Z
  210.  
  211.     after this structure check for more chunks.
  212.  
  213.         id              Description    ( full description later )
  214.        0010             RGB colour
  215.        0011             24 bit Colour
  216.        4610             Spot light
  217.        4620             Light is off   (Boolean)
  218.        
  219.  
  220.    * 4610   -  Spot Light
  221.  
  222.  
  223.    start end  size  type        name  
  224.     0     3    4    float       Target pos X
  225.     4     7    4    float       Target pos Y
  226.     8    11    4    float       Target pos Z
  227.     12   15    4    float       Hotspot
  228.     16   19    4    float       Falloff
  229.  
  230.      
  231.    * 0010  - RGB colour
  232.  
  233.    start end  size  type        name  
  234.     0     3    4    float       Red
  235.     4     7    4    float       Green
  236.     8    11    4    float       Blue
  237.  
  238.  
  239.    * 0011  - RGB colour  -  24 bit
  240.  
  241.    start end  size  type        name  
  242.     0     0    1    byte        Red
  243.     1     1    1    byte        Green
  244.     2     2    1    byte        Blue
  245.       
  246.  
  247.    * 4700  - Camera
  248.  
  249.    Describes the details of a camera in the scene.
  250.  
  251.    start end  size  type        name  
  252.     0     3    4    float       Camera pos X
  253.     4     7    4    float       Camera pos Y
  254.     8    11    4    float       Camera pos Z
  255.     12   15    4    float       Target pos X
  256.     16   19    4    float       Target pos Y
  257.     20   23    4    float       Target pos Z
  258.     24   27    4    float       Camera Bank       
  259.     28   31    4    float       Camera Lens
  260.  
  261.    * 7001  - unknown chunk
  262.  
  263.    nothing known about this chunk except for its Subchunks.
  264.    This chunk also exists as a Subchunk in chunk B000 (keyframer info).
  265.  
  266.     id          Description
  267.    7011         unknown
  268.    7020         unknown
  269.  
  270.  
  271.    * B000   -  Keyframer Main chunk.
  272.  
  273.    Subchunks are
  274.  
  275.     id          Description
  276.    B00A         unknown
  277.    7001         unknown
  278.    B008         Frames  
  279.    B009         unknown
  280.    B002         Start object description
  281.  
  282.  
  283.    * B008   - Frame information
  284.  
  285.      simple structure describing frame info.
  286.  
  287.    start end  size  type        name  
  288.      0    3     4   integer     start frame
  289.      4    7     4   integer     end frame
  290.  
  291.  
  292.    * B002   - Start of Object info
  293.  
  294.      Subchunks
  295.  
  296.      id         Description
  297.     B010        Name & Hierarchy
  298.     B011*       Name Dummy object
  299.     B013        unknown
  300.     B014*       unknown
  301.     B015        unknown
  302.     B020        Objects pivot point?
  303.     B021        unknown
  304.     B022        unknown
  305.  
  306.  
  307.          ( * only on dummy objects )
  308.  
  309.    * B010   -  Name & hierarchy descriptor
  310.  
  311.    start end  size  type        name  
  312.      0    ?     ?   ASCIIZ      Object name
  313.      ?    ?     ?   short int   unknown
  314.      ?    ?     ?   short int   unknown
  315.      ?    ?     ?   short int   Hierarchy of object
  316.  
  317.      The object hierarchy is a bit complex but works like this.
  318.      Each object in the scene is given a number to identify its 
  319.      order in the tree.  Also each object is ordered in the 3ds 
  320.      file as it would appear in the tree.
  321.      The root object is given the number -1 (FFFF).
  322.      As the file is read a counter of the object number
  323.      is kept.
  324.      Is the counter increments the object are children of the previous
  325.      objects.  But when the pattern is broken by a number that will be
  326.      less than the current counter the hierarchy returns to that level.
  327.  
  328.      for example.
  329.  
  330.              object   hierarchy
  331.              name
  332.  
  333.                 A      -1
  334.                 B       0
  335.                 C       1                       This example is taken
  336.                 D       2                       from 50pman.3ds.
  337.                 E       1
  338.                 F       4                       I would really recommend
  339.                 G       5                       having a look at one of
  340.                 H       1                       the example with the
  341.                 I       7                       hierarchy numbers to help
  342.                 J       8                       work it out.
  343.                 K       0
  344.                 L      10
  345.                 M      11                       (if you can describe it
  346.                 N       0                        any better please let
  347.                 O      13                        me know. )
  348.                 P      14
  349.  
  350.  
  351.  
  352.  
  353.                                A
  354.            +-------------------+---------------+
  355.            B                   K               N
  356.        +---+---+               +               +
  357.        C   E   H               L               O
  358.        +   +   +               +               +
  359.        D   F   I               M               P
  360.            +   +
  361.            G   J
  362.  
  363.  
  364.  
  365.        Still not done with this chunk yet!
  366.  
  367.        If the object name is $$$DUMMY then it is a dummy object 
  368.        and therefore you should expect a few extra chunks.
  369.  
  370.  
  371.    *  B011   -  Dummy objects name.
  372.  
  373.         Names a dummy object. ASCIIZ string.
  374.  
  375.    *  B020  - Pivot Point?
  376.  
  377.    The objects pivot point.  Not quite sure what the first 
  378.    five floats do yet (ideas?).
  379.  
  380.    start end  size  type        name  
  381.      0    3     4   float       unknown    
  382.      4    7     4   float       unknown  
  383.      8   11     4   float       unknown    
  384.     12   15     4   float       unknown  
  385.     16   19     4  27     4   float       Pivot Y    
  386.     28   32     4   float       Pivot Z  
  387.  
  388.  
  389. *****
  390.    This file is not copyrighted, give it to whoever you want.  If you do
  391.    something with it you shouldn't.  Tough.  Don't come crying to me!
  392.  
  393.    This is the first public release and its later so expect some errors.
  394.  
  395.    If you copy this file please keep all the footers and headers intact.
  396.  
  397.    Regards
  398.  
  399.       Jim Pitts
  400.       19th december 1994
  401.       3:42 am!
  402.  
  403.    jp5@ukc.ac.uk
  404.  
  405. *****
  406. <EOF>
  407.  
  408.  
  409.  
  410. -------------------------------------------------------------------------
  411. To find out more about the anon service, send mail to help@anon.penet.fi.
  412. Due to the double-blind, any mail replies to this message will be anonymized,
  413. and an anonymous id will be allocated automatically. You have been warned.
  414. Please report any problems, inappropriate use etc. to admin@anon.penet.fi.
  415.  
  416.