[comp.graphics] Enterprise 3D database query

kelvin@im4u.UUCP (Kelvin Thompson) (04/09/88)

Do I remember correctly that someone posted a 3D database of
the (old) Starship Enterprise a few weeks ago?  I neglected
to make a copy then, but I'd like one now.

Would somebody please e-mail me one of the following:

  [1]  An internet address where I can FTP this database.

  [2]  An *OFFER* to e-mail me the database itself.  I'll
       reply to the closest or easiest offer (I don't want
       to get a dozen copies of a big database).

  [3]  Other hints or pointers about how to get the database.

I'll also need a textual description of the format (I recall
that it was binary).  If there is much interest, I'll summarize.

Thanks in advance.

-- 
-- Kelvin Thompson, Lone Rider of the Apocalypse
   kelvin@cs.utexas.edu  {ihnp4,ctvax,seismo,ucbvax}!ut-sally!im4u!kelvin 

UD140469@NDSUVM1.BITNET (04/09/88)

[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]

rrr@naucse.UUCP (Bob Rose ) (04/12/88)

In article <699UD140469@NDSUVM1>, UD140469@NDSUVM1.BITNET writes:
> [posted the binarys to enterprise and f14 because ...]
> file format:
>      [ a data format (or what he though was the data format)]

Well I tried the format and BOOM! I've narrowing it down though.
[Note a word is 16 bits, first-byte*256 + second-byte]
    word: junk             (file id)
    word: count of objects (1-40)
    30 bytes of junk
    loop for the number of objects:
        9 bytes for name
        word: number of vertices
		loop for the number of vertices
             x,y,z all 4 bytes each
        word: number of faces (each face a triangle)
		loop for the number of faces
             a,b,c,d all 2 bytes each (a,b,c are vertic numbers, d 
                                       is other data)

The thing is I haven't been able to figure out how to arrange the
4 bytes in the x, y, z to get useful data. I've tried a float, longs, etc.
(They all have the high bit set if that helps.)
At the end of the article is some code to extract the data, but again
I don't know how to print out the verts.

> I hope this all helps.  If it causes me much more trouble I'll probably stop
> posting objects.
>                       Scott Udell

Please, don't stop posting unless we can't figure out the format.
And surely we can figure it out, just like we figured out if a
point was inside a poly :^)
It's nice to have people out on the net willing to share.

Heres the code. Please no FLAMES that it looks like garbage, I ran it
through the wrong formatter to shorten it up.
-----------------------cut here-------------------
#include <stdio.h>
getword()
{ register int i; i = 256*getchar(); i += getchar(); return i; }

main(argc, argv)
int argc;
char *argv[];
{ int i, j, num;
	getword(); num = getword(); for (i = 0; i < 30; i++) getchar();
	for (i = 0; i < num; i++) doit(); }

doit() {
	int i, j, x, y, z, w; char s[10];
	for (i = 0; i < 9; i++) s[i] = getchar();
	printf("%s\n", s);
	j = getword(); printf("verts = %d\n", j);
	for (i = 0; i < j; i++) {
		x = getword(); x = x*65536 + getword();
		y = getword(); y = y*65536 + getword();
		z = getword(); z = z*65536 + getword();
		printf("%d %d %d\n", x, y, z); }
	j = getword(); printf("poly = %d\n", j);
	for (i = 0; i < j; i++) {
		x = getword(); y = getword(); z = getword(); w = getword();
		printf("%d %d %d %d\n", x, y, z, w); }
}
-------------------end here--------------------
Robert R. Rose
Northern Arizona University, Box 15600
Flagstaff, AZ 86011
                    .....!ihnp4!arizona!naucse!rrr

cam@ptisea.UUCP (cameron elliott) (04/14/88)

If the 3D database is in CAD3D format from the Atari St,
the floats are in Motorola Fast Floating Point Format.

Which I believe is 23bits of mantissa, 1sign, 8exp,
or maybe( 24bits mantissa, 1sign, 7exp).
and the Most Significant bit of the mantissa is included in the
number. (Different from IEEE)
(Note that is why the most significant bit is always 1.) 

-- 
Disclaimer: If employees dont represent an organization what does?
Cameron Elliott		Portable Cellular Communications
Path: ...!uw-beaver!tikal!ptisea!cam