From albanycs!leah:rsb584 Wed Apr 20 01:30:54 1988 Received: by albanycs.albany.edu (5.54/4.8) id AA10548; Tue, 19 Apr 88 21:55:21 EST Date: Tue, 19 Apr 88 22:55:14 EDT From: albanycs!leah:rsb584 (Raymond S Brand) Received: by leah.Albany.EDU (5.58/1.1) id AA00265; Tue, 19 Apr 88 22:55:14 EDT Message-Id: <8804200255.AA00265@leah.Albany.EDU> To: albanycs:beowulf!rsbx Subject: 3dcad.fmt >From UD140469@NDSUVM1.BITNET Fri Apr 8 23:39:28 1988 Path: leah!itsgw!steinmetz!uunet!ndsuvax!ndsuvm1.bitnet!ud140469 From: UD140469@NDSUVM1.BITNET Newsgroups: comp.graphics Subject: Re: Enterprise 3D database query Message-ID: <699UD140469@NDSUVM1> Date: 9 Apr 88 03:39:28 GMT References: <2641@im4u.UUCP> Organization: North Dakota Higher Education Computer Network, Fargo, ND Lines: 148 DISCLAIMER: Author bears full responsibility for contents of this article. [a line for the line eater] Hello folks. I posted the Enterprise along with a couple of other files from my PD library of objects created with the CAD 3D program for the Atari ST. Originally I was going to post in ascii, but got too many complaints about the size or that I wasn't using everybody's favorite compaction format (which seemed different for every message I got). I decided to just uudecode the binary and send it off, because someone told me they were going to post the source to an ascii converter program "in a couple of weeks." Well, that person must have run into some difficulty, because almost a month later (and a lot of complaints to me) there's still no converter. To solve the problem I bought the CAD 3D developers disk to get info on the file format, which appears below. One difficulty with the information is that it covers the newer 3D2 format instead of the plain 3D format of the objects I posted. According to the docs the difference is in the storage of vertex coordinates. The older version used the "Motorola Fast Floating Point library (LIBF)," a 4-byte floating point number. The new version uses two-byte word. If you can figure out LIBF, you should have no trouble. If too many people are having trouble with the LIBF, I can repost the objects I've posted (an F14, the Enterprise, and a sort-of San Francisco (originally posted in ascii)). I can not, however, mail out to individuals: I only have limited storage room on-line (so I can't afford to store objects for long periods of time), and it takes my too long to upload objects at 1200 baud every time I get a request (which tend to spread themselves out over weeks). As for suggestions that I set up my files for FTP, I can't--I'm on BITNET. I doubt I could set up a bitnet server (I'm just a student on a crowded IBM). Also, for those having trouble with my uudecode format (one gentleman wrote to me, but I couldn't get a message back to him), try whacking off the first couple of lines (up to the "begin"). I'm told it's supposed to be Vax standard, but I'm not certain. Enough of this and on to the file format: First there's a 256 byte header: word : file id word : count of objects in file (1-40) word : light source A indicator (1=on, 0=off) word : " B word : " C word : light source A brightness (0-7) word : " B word : " C word : A z postion (-50 to +50) word : B " word : C " word : A y " word : B " word : C " word : A x " word : B " word : C " 32 words : object color palette (BIOS format) 32 words : color group base array word : color palette type (0=seven-shade, 1=fourteen shade, 2=custom) word : wireframe line color (1-15) word : outline line color (0-15) 150 bytes extra From then on the object data is variable, based on the number of objects and what they contain. For each object the info is as follows: 9 bytes : 8 char name w/ null terminator word : number of vertices in object (15000 max) What follows defines the X, Y, and Z coordinates for each vertex in the object. Each piece is made up of three words and repeats for each vertex (specified in the count above): word : X coord of vertex, stored in fixed point format. Ex: a value of 3456 = 34.56 -- read in the value, convert to FP, and / by 100 word : Y " word : Z " After the vertices have been read in, the file lists the triangular faces of the object. word : face count (30000 max) Each face is made up of four words, each is triangular, and is defined by 3 vertices (A, B, C). The fourth word is described below. word : # of the first vertex in the face (termed point A). It can be a number corresponding to any one of the vertices designated above. word : " point B word : " point C word : color/edge flag indicator (THIS IS IMPORTANT). The low byte of this value ranges from 1 to 15 and tells the color of the face. The upper byte tells the program which edges are to be shown by a line segment when drawing in "edges only" mode. The three low-order bits are used as flags for this purpose: a 0 in a bit means that no line is to be drawn, a 1 means that it is. The bit assignments are: Bit 0: line from C-A Bit 1: " B-C Bit 2: " A-B The face data repeats until all faces have been defined. ---------------------------------------------------------------------------- Some notes: I'm not certain if the face and vertex info are grouped by object or in separate area (although I assume it's something like Obj 1: vertices & faces, Obj 2: vertices & faces, etc.). Where I've used " it means same as the line above. I've not included the in-depth descriptions of all the info in the doc- mentation, although what I did have comes almost directly (with little or no rewritting) from their stuff. Any more might be too much in regards to copy- rights, etc. If you want more info, don't write me but buy the disk. It comes with an 83 page manual (on disk) with info on how to write applications that communicate with CAD 3D via a pipeline system, the functions acessable to such utilitys, file formats for the main objects, the extrudes and spin templates, and the Cybermated compressed delta file format (animated sequences). Better yet, contact the author Tom Hudson on Compuserve (76703,4224) in the ATARI16 or ATARIDEV forums or by Easyplex e-mail. He can also be reached on occasion on Delphi (THUD), BIX (thudson), or GEnie (T.HUDSON). I hope this all helps. If it causes me much more trouble I'll probably stop posting objects (and I will stop by May 13 when I go to Houston for the summer, so you'd better get any opinions to me quickly). Scott Udell UD140469@NDSUVM1.BITNET [a line for the line eater]