Talk:3DS

From GPWiki

I've noticed that these specs seem to imply that the length field of the chunk headers doesn't include the 6 bytes for the header itself, however in my specimen files the length field *does* include the length of the header. After reading the header, to skip to the next chunk you seek forward by (length - 6). -Doug Sheets

It's quite common for the length of the entire header (I don't know of anything that *doesn't* do it this way), including the length/size field. I suppose it can be confusing to remember that you already chewed up 6 bytes.

-- Ryan


I was more trying to point out that the specs say some ambiguous (or in the case of one spec I didn't link to, completely wrong) things regarding the length field of the headers such as "The chunk_len indicates the length of following data to be associated with this chunk." Upon first reading that I thought the header length field didn't include the 6 bytes for the header itself, which is incorrect.

--Doug Sheets

Adding 3ds fileformat stuff

I want to add this

I'm wiki newb; don't understand this code tag thing:

From http://www.martinreddy.net/gfx/3d/3DS.spec and modified by me (added stuff to EDIT_MATERIAL)

               MAIN3DS  (0x4D4D)
                 |
                 +--EDIT3DS  (0x3D3D)
                 |  |
                 |  +--EDIT_MATERIAL (0xAFFF)
                 |  |  |
                 |  |  +--MAT_NAME01 (0xA000) (See mli Doc) 
                 |  |     |
                 |  |     +-- TEXTURE_INFO (0xA200) 
                 |  |         |
                 |  |         +-- TEXTURE_FILE (0xA300) 
                 |  |     
                 |  |     
                 |  +--EDIT_CONFIG1  (0x0100)
                 |  +--EDIT_CONFIG2  (0x3E3D) 
                 |  +--EDIT_VIEW_P1  (0x7012)
                 |  |  |
                 |  |  +--TOP            (0x0001)
                 |  |  +--BOTTOM         (0x0002)
                 |  |  +--LEFT           (0x0003)
                 |  |  +--RIGHT          (0x0004)
                 |  |  +--FRONT          (0x0005) 
                 |  |  +--BACK           (0x0006)
                 |  |  +--USER           (0x0007)
                 |  |  +--CAMERA         (0xFFFF)
                 |  |  +--LIGHT          (0x0009)
                 |  |  +--DISABLED       (0x0010)  
                 |  |  +--BOGUS          (0x0011)
                 |  |
                 |  +--EDIT_VIEW_P2  (0x7011)
                 |  |  |
                 |  |  +--TOP            (0x0001)
                 |  |  +--BOTTOM         (0x0002)
                 |  |  +--LEFT           (0x0003)
                 |  |  +--RIGHT          (0x0004)
                 |  |  +--FRONT          (0x0005) 
                 |  |  +--BACK           (0x0006)
                 |  |  +--USER           (0x0007)
                 |  |  +--CAMERA         (0xFFFF)
                 |  |  +--LIGHT          (0x0009)
                 |  |  +--DISABLED       (0x0010)  
                 |  |  +--BOGUS          (0x0011)
                 |  |
                 |  +--EDIT_VIEW_P3  (0x7020)
                 |  +--EDIT_VIEW1    (0x7001) 
                 |  +--EDIT_BACKGR   (0x1200) 
                 |  +--EDIT_AMBIENT  (0x2100)
                 |  +--EDIT_OBJECT   (0x4000)
                 |  |  |
                 |  |  +--OBJ_TRIMESH   (0x4100)      
                 |  |  |  |
                 |  |  |  +--TRI_VERTEXL          (0x4110) 
                 |  |  |  +--TRI_VERTEXOPTIONS    (0x4111)
                 |  |  |  +--TRI_MAPPINGCOORS     (0x4140)  AKA TRI_TEXCOORDS
                 |  |  |  +--TRI_MAPPINGSTANDARD  (0x4170)
                 |  |  |  +--TRI_FACEL1           (0x4120)
                 |  |  |  |  |
                 |  |  |  |  +--TRI_SMOOTH            (0x4150)   
                 |  |  |  |  +--TRI_MATERIAL          (0x4130)
                 |  |  |  |
                 |  |  |  +--TRI_LOCAL            (0x4160)
                 |  |  |  +--TRI_VISIBLE          (0x4165)
                 |  |  |
                 |  |  +--OBJ_LIGHT    (0x4600)
                 |  |  |  |
                 |  |  |  +--LIT_OFF              (0x4620)
                 |  |  |  +--LIT_SPOT             (0x4610) 
                 |  |  |  +--LIT_UNKNWN01         (0x465A) 
                 |  |  | 
                 |  |  +--OBJ_CAMERA   (0x4700)
                 |  |  |  |
                 |  |  |  +--CAM_UNKNWN01         (0x4710)
                 |  |  |  +--CAM_UNKNWN02         (0x4720)  
                 |  |  |
                 |  |  +--OBJ_UNKNWN01 (0x4710)
                 |  |  +--OBJ_UNKNWN02 (0x4720)
                 |  |
                 |  +--EDIT_UNKNW01  (0x1100)
                 |  +--EDIT_UNKNW02  (0x1201) 
                 |  +--EDIT_UNKNW03  (0x1300)
                 |  +--EDIT_UNKNW04  (0x1400)
                 |  +--EDIT_UNKNW05  (0x1420)
                 |  +--EDIT_UNKNW06  (0x1450)
                 |  +--EDIT_UNKNW07  (0x1500)
                 |  +--EDIT_UNKNW08  (0x2200)
                 |  +--EDIT_UNKNW09  (0x2201)
                 |  +--EDIT_UNKNW10  (0x2210)
                 |  +--EDIT_UNKNW11  (0x2300)
                 |  +--EDIT_UNKNW12  (0x2302)
                 |  +--EDIT_UNKNW13  (0x2000)
                 |  +--EDIT_UNKNW14  (0xAFFF)
                 |
                 +--KEYF3DS (0xB000)
                    |
                    +--KEYF_UNKNWN01 (0xB00A)
                    +--............. (0x7001) ( viewport, same as editor )
                    +--KEYF_FRAMES   (0xB008)
                    +--KEYF_UNKNWN02 (0xB009)
                    +--KEYF_OBJDES   (0xB002)
                       |
                       +--KEYF_OBJHIERARCH  (0xB010)
                       +--KEYF_OBJDUMMYNAME (0xB011)
                       +--KEYF_OBJUNKNWN01  (0xB013)
                       +--KEYF_OBJUNKNWN02  (0xB014)
                       +--KEYF_OBJUNKNWN03  (0xB015)  
                       +--KEYF_OBJPIVOT     (0xB020)  
                       +--KEYF_OBJUNKNWN04  (0xB021)  
                       +--KEYF_OBJUNKNWN05  (0xB022)


My only concern is copyright. Can it simply be posted up(You can easily find the tree in the document)? The reason is to have updated 3ds file hararchy which I can't find a complete one. And if its posted up and people add stuff as they need/discover something it would be more up to date. Like Theres code for loading materials but I don't see any documents showing the structure of EDIT_MATERIAL and had to pretty much experiment myself to figure out its relationship.