APPENDIX C SCULPT ANIMATE FILE FORMATS The files generated by Sculpt Animate follow the IFF standard, with the exception of the RGB files described in chapter 3. The .i.IFF.i. format is described in the Amiga ROM Kernel Manual, and sample programs to read and write such files may be found in The file formats used by the Sculpt series of programs for the Amiga are constantly changing, through the addition of new chunk types and the definition of reserved 'padding' bytes in existing chunks. In most cases this will not present problems either w Image files Images are written as .i.ILBM; IFF files and need little further explanation here, since they conform to the published standards. Because of the variety of image size and mode that Sculpt Animate uses, programs which intend to use these images shouldn't Images saved in conjunction with frame buffer usage are non-standard, but follow the ILBM format. These images have no CMAP chunk, so the bit planes represent actual 24-bit color intensity values: 8 planes each of red, green, and blue--stored in that or Scene files Scene files contain a number of data chunks. Each chunk is described below in terms of a C structure. The comments beside each structure member should make its meaning clear. The FORM name for a scene file is 'SC3D'. /* Chunk 'LAMP' contains one or more of the following structures, the number of structures is determined by the length of the chunk */ struct elamp { long int pos[3]; /* The position of the lamp */ long int brightness; /* The brightness of the lamp */ unsigned char color[3]; /* The color of the lamp as a triple of RGB values, range 0 to 255 */ char pad; /* Unused */ }; /* Chunk 'OBSV' contains a specification of an observer according to the following structure */ struct observer {long int obsmode; /* Rendering mode as follows 0 Painting 1 Snapshot 2 Photo 3 Wireframe 4 Sketch 5 Scanline painting 6 Scanline snapshot */ long int fl; /* Focal length of lens in millimeters */ long int althresh; /* For internal use only */ long int threshhold; /* For internal use only */ long int robspos[3]; /* Position of observer */ long int rtarget[3]; /* Position of target */ short int hires; /* 0 for low 1 for high resolution */ short int lace; /* 0 for non-interlace 1 for interlace */ short int lens; /* Lens type as follows: 0 Normal 50mm 1 Wide angle 28mm 2 Telephoto 135mm 3 Special, as given by spfl */ short int manexpflg; /* 0 for auto exposure else manual */ long int spfl; /* Focal length of special lens */ long int expoverride; /* Current value for exposure override */ long int manexpval; /* Value when in manual mode */ long int picsize; /* Image size as follows 0 Tiny 1 Small 2 Medium 3 Full 4 Jumbo 5 Video */ long int tilt; /* Tilt angle */ long int aamode; /* Anti aliasing mode as follows: 0 None 1 Good 2 Best */ short int dithatten; /* Dithering attenuation as follows: 0 Standard 50 Half standard, etc 100 None */ short int colorlock; /* Non zero for locking colors */ short int explock; /* Non zero for locking exposure value */ short int expexp; /* Internal use only */ long int expmant; /* Internal use only */ unsigned char wfcol1[4],wfcol2[4]; /* Colors for wire frame images */ short int displayearly; /* Non zero to request early display of rendered image */ short int dummy[29]; /* Reserved for future use, should be set to zero. */ }; /* Chunk 'WRLD' contains a specification of the world using the following structure */ struct world {long int groundmode; /* 0 None, 1 solid, 2 checkered */ long int skymode; /* 0 None, 1 solid, 2 graduated */ long int checkscale; /* Size of checkered ground */ unsigned char backbright[3]; /* Intensity of background illumination as RGB values on a scale of 0 to 255 */ unsigned char grcol1[3],grcol2[3]; /* Colors of ground squares as RGB values on a scale of 0 to 255 */ unsigned char skycol1[3],skycol2[3]; /* Sky colors as RGB values on a scale of 0 to 255 */ long int dummy[20]; /* Reserved for future use, should be set to zero */ }; /* Chunk 'VERT' contains an array of the following structure, one element for each vertex to be included in the scene */ struct evertex {long int pos[3]; /* Position of vertex */ }; /* Chunk 'EDGE' contains an array of the following structure, one element for each edge in the scene */ struct eedge {long int evertexi[2]; /* Indices denoting vertices in VERT chunk */ }; /* Chunk 'FACE' cantains an array of the following structures, one element for each face in the scene */ struct eface {long int evertexi[3]; /* Indices denoting vertices in VERT chunk */ unsigned char color[3]; /* Face color as RGB values in the range 0 to 255 */ unsigned char texture; /* The most significant bit is set if smoothing is needed. The remaining bits represent a texture value as follows: 0 Dull 1 Shiny 2 Mirror 3 Luminous 4 Glass 5 Metal 6 Glass2 */ }; /* The chunk 'HIER' contains an array of the following structures, one element for each name in the hierarchy */ struct ehier {short int parindex; /* index to the hierarchy element that is the parent of this element */ char name[10]; /* Name of hierarchy element */ short int type; /* Type of element, as follows: 0 Empty 2 Lamp 4 Path 6 Target 8 Observer location 10 Vertices Bit 0x10 is set if a local origin is used by this element */ short int loverti; /* index to the vertex that is the local of this element */ long int lo[3]; /* Local origin position */ }; /* Chunk 'VNAM' contains an array of the following structure, one element for each vertex that has a hierarchy name */ struct ename {short int object; /* index to vertex */ short int name; /* index to hierarchy name */ }; /* The chunk 'LNAM' contains an array of short integer values representing the hierarchy indices for each lamp. Unnamed lamps are given an index of -1. */ /* The chunk 'PATH' contains an array of the following structure, one element for each vertex that is a part of a path. */ struct epath {int evertexi; /* Index to vertex */ long int etumbleaxes[3][3]; /* Tumble axis directions, scaled by a factor of 1L<<30 */ int terminator; /* Code value with bits set as follows: 1 end of path 2 end of loop 4 interpolated */ }; /* The chunk 'KNOT' contains an array of the following structure, one element for each knot vertex included in the scene */ struct eknot {long int eslopes[2][3]; /* Knot slopes scaled by 1L<<30 */ long int espeeds[2]; /* Speed values scaled by 1L<<30 */ short int evertexi; /* index to vertex */ short int terminator; /* Code value with bits set as follows: 1 end of spline 2 end of loop 4 interpolated 8 cusp */ }; /* The chunk 'SPLN' contains an array of the following structure, one element for each non-knot spline vertex */ struct espline {short int evertexi; /* Index to vertex */ short int evertknoti; /* Index to knot */ }; /* The chunk 'CSGE' contains a CSG object type identifier, and a long array of indices to vertices of the object */ struct ecsg {short int type; /* set as follows: 0 sphere */ long int evertexi[12]; /* Indices to vertices in CSG sphere */ }; Take files A take is automatically saved to disk at frequent intervals as a file whose name ends with '.take'. It is an IFF file with a form name called 'TAKE' containing the following chunks. /* Chunk 'THDR' contains the following structure: */ struct take {int frmode; /* set to 1 for frame mode */ int rammode; /* set as follows: 0 not RAM animation 1 normal RAM animation 2 economy RAM animation 3 ANIM-5 RAM animation */ int numframes; /* number of frames in the take */ int curframe; /* current frame number */ int saveimages; /* set to 1 if frames are to be saved to disk */ int prevsize; /* preview size as follows: 2 Medium 3 Full */ int motionblur; /* set for motion blur */ int loopmode; /* set as follows: 0 no loop 1 loop 2 oscillation */ int framebuffer; /* set if frame buffer is in use */ int framecontroller; /* set if frame controller is in use */ char anidrawer[22]; /* animation drawer name */ char foreground[22]; /* foreground file name */ char background[22]; /* background file name */ char pad1[22]; /* unused, should be set to zero */ char fcname[22]; /* frame controller name */ char pad2[22]; /* unused, should be set to zero */ char fbname[22]; /* frame buffer name */ short int colorlock /* set when colors are locked */ char creg[96]; /* current color registers */ short int explock; /* set when exposure values are locked */ short int expexp; /* internal use only */ long int expmant; /* internal use only */ short int obsmode; /* Rendering mode as follows 0 Painting 1 Snapshot 2 Photo 3 Wireframe 4 Sketch 5 Scanline painting 6 Scanline snapshot */ short int hires; /* 0 for low and 1 for high resolution */ short int lace; /* 0 for non-interlace 1 for interlace */ short int picsize; /* Image size as follows 0 Tiny 1 Small 2 Medium 3 Full 4 Jumbo 5 Video */ short int bitplanes /* number of bit planes */ unsigned char wfcol1[4],wfcol2[4]; /* colors for wire frame rendering */ char padding[64]; /* unused, should be set to zero */ }; /* The remaining chunks are of type 'TFRM', one for each frame in the take. Each chunk contains the following structure */ struct etakeframe {short int framenum; /* Frame number */ short int keyframe; /* Set to 1 if it is a keyframe */ short int duration; /* Duration, in jiffies */ char imadrawer[22]; /* image drawer name */ char scedrawer[22]; /* scene drawer name */ char padding[64]; /* unused, should be set to zero */ };