home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Homebrewer's Handbook / vr.iso / claywork / format.txt < prev    next >
Text File  |  1996-03-19  |  2KB  |  60 lines

  1. ClayWorks ShareWare '.3d' file format:
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3.  
  4. This is a simple binary file format but please note: The floating point
  5. values are Turbo Pascal real's. If this differs from your complier then
  6. you may have to make a conversion to the numbers.
  7.  
  8. the first 3 words of the file are thus:
  9.  
  10. No_of_points (2 bytes)
  11. No_of_joins (2 bytes)
  12. No_of_Polygons (2 bytes)
  13.  
  14. The next block is the 'points' block which is an array of this record
  15.  
  16. Vector=
  17.   x,y,z:pascal real
  18. end
  19.  
  20. with 'no of points' entries.
  21.  
  22. The second block is of this record
  23.  
  24. Join
  25.   from,to:word (2 bytes)
  26. end
  27.  
  28. which is a reference to the points list with indexes starting from 0.
  29. This has 'no of joins' entries.
  30.  
  31. The last block is the polygons list. The polygon structure is thus:
  32.  
  33. polygon=
  34.   number_of_sides:byte
  35.   point_references:array[0..3] of word (2 bytes each)
  36.   colour:byte
  37.   DoubleSided:boolean
  38. end
  39.  
  40. At the moment 'number_of_sides' can not exceed a value of 4.
  41. 'point_references' refers to the point list in much the same way
  42. as the joins do. Polygons are all closed, there will be changes to this
  43. format.
  44. This list has 'No_of_polygons' entries.
  45.  
  46.  
  47. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. Future changes to this format are inevitable -I only give the format
  49. away so that you can use the objects in your own programs.
  50.  
  51. This format will include a texture 'palette' to which references are made
  52. by the polygons. The file will also include a Version header.
  53. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  54.  
  55. For more info, mail me at:
  56.  
  57. csc023@cent1.lancs.ac.uk
  58.  
  59. (c) T.lewis 1995.
  60.