home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Avalon - 3D Objects & Resources
/
Avalon.iso
/
frmtspcs
/
3dxform.txt
< prev
next >
Wrap
Text File
|
1995-01-01
|
5KB
|
150 lines
This file is for programmers that would like to use this file
format, to include them into their programs/demos.
The purpose of this new object format is to provide an optimised
object, for the different displaying modes, with expansion possi-
bilities, and the needed informations for 3d-clipping, animation,
and so on. The comments are preceded by a semi-colon:
;Here is the explanation of the different fileds:
;the length of the fields is given in bytes, in brackets.
"3DX01" + '\0', Null terminated identifier. (6)
;Now we got three different descriptions of the object, depending
;on the distance viewer-object: there is no point of drawing
;120 faces that are not bigger than one pixel, because the object
;is too far away.
;Short range description:
NOBJS_0 How many objects are there? (2)
{
NAME, A null terminated name for the object
len(name + null char) <= 15 (15)
NPTS, How many 3d points are there? (2)
NFFCS, How many faces are there for the shaded faces
representation? (2)
NWFCS, How many faces are there for the wireframe
representation? (2)
;The faces can have any number of vertices, they can be triangles,
;squares,... so we need to know, to know exactly how big the memory
;allocation should be, how big the sum of the number of vertices of
;every face is:
; if VFi,VWi is the number of vertices of the ith face for the
; shaded representation resp. the wireframe representation, then we
; need:
NFOFFS, = VF1+VF2+...VFn , n=NFFCS (2)
NWOFFS, = VW1+VW2+...VWn , n=NWFCS (2)
;Boundings of the object:
XMAX,XMIN,YMAX,YMIN,ZMAX,ZMIN, (2 each=12)
;Coordinates (=Crd.) of the gravity center of the object:
[Xg,Yg,Zg], (2 each=6)
;Crd. of the three light sources:
[Xl,Yl,Zl]*3, (6*3=18)
;Crd. of the points of the object (points table):
[X,Y,Z]*NPTS, (6*NPTS)
;Description of the shaded faces:
[
COL, coulour of the face (2)
NOFFS, # of vertices in the face (2)
;Here we have the description of the polygon. the ith OFFSET is the offset
;in the points table of the ith vertex.
;!!! Important !!! OFFSET is the offset of the *point* not the
;offset of the first coordinate:
; x1,y1,z1 <---- OFFSET == 0
; x2,y2,z2 <---- OFFSET == 1, and not equal 6 (6 bytes further)!
(OFFSET)*NFOFFS, (2*NFOFFS)
(Nx,Ny,Nz), Normal vector of the face (2*3=6)
(Xg,Yg,Zg), Gravity center of the face (2*3=6)
]*NFFCS,
;Description of the wireframe faces:
[
NOFFS, # of vertices in the face (2)
;Here we need to know, for each vertex in the face, if there has to be
;a drawn line from the actual point to the next point in the list.
;Ex:
; 1 2
; *---------------------------------*
; / Face 1 \
; / \
; 4*--This line should only be drawn once--*3
; / /
; / Face 2 /
; *---------------------------------------*
;From point 3 to point 4, there'll be no line for face 1, so here,
;CONT=0 on point 3. "no line from 3 to 4"
;Description of Face1:
;NOFFS==4
;(OFFSET==1,CONT==1)
;(OFFSET==2,CONT==1)
;(OFFSET==3,CONT==1)
;(OFFSET==4,CONT==0)
;and every line of Face2 is drawn.
;Of course, on situations like this:
; 1 2
; *-----*---------------------------------*
; /Face / Face 1 \
; / 3 / \
;*----4*--This line should only be drawn once--*3
; / /
; / Face 2 /
; *---------------------------------------*
;instead of having "no line from 3 to 4" and "no line from 4 to 1",
;the OFFSET 4 will simply not be present, so the face 1 will be:
;Description of Face1:
;NOFFS==3
;(OFFSET==1,CONT==1)
;(OFFSET==2,CONT==1)
;(OFFSET==3,CONT==0)
;OFFSET has the same meaning as above.
;and every line of Face2 and Fcae3 is drawn.
(OFFSET,CONT)*NWOFFS (4*NWOFFS)
]*NWFCS
;This additional zone is always structured this way (if not empty,
;that is, its length is 0):
additional zone=
[
-LEN length of additional zone (4)
-a 9 BYTES, null terminated string identifier:
("BSPTREE" , "MAPTGA" ,"" (if empty)...) (9)
-LEN bytes actual description of the zone
-[additional zone] ;next additional zone (might be empty)
]
}*NOBJS_0
;The description of the medium and the long range objects is the same.
NOBJS_1,
{...}*NOBJS_1
NOBJS_2,
{...}*NOBJS_2
Nikopol (Flatliner)
Ok, that's it. If you have a good idea of an expansion to the format,
please send it to me (with its format). My mail adresses are:
email:
lmuniz@vub.ac.be on internet
smail:
Luis Muniz
564 chaussee de Boondael
B-1050 Brussels
Belgium
from august/september on:
54, rue Dillens
B-1050 Brussels
Belgium