*************************************************************

                 dgo file format v1.0

                   1999.2.24 Gamza
		         dgPIX entertainment

*************************************************************

file format ϱ  structure...
=============================================================
typedef signed	 char	S8;
typedef signed	 short  S16;
typedef signed   long	S32;
typedef unsigned char	U8;
typedef unsigned short  U16;
typedef unsigned long	U32;

typedef struct _tagDGO_HEADER
{
	S32 Version;
	S32 ImageCount;
	S32 SurfaceCount;
	S32 VertexCount;
	S32 FaceCount;
	S32 PivotCount;
	S32 ShadeType;
}	_DGO_HEADER;

typedef struct tagVertex
{
	float x,y,z;
} Vertex;

typedef struct tagFace
{
	U32		numvertex;
	U16		vertex[4];
	float	u[4],v[4];
}	Face;

typedef struct tagSurface
{
	U8	r, g, b, a;
	S16	imageindex;
	U16	drawoption;
	U32	faceCount;
}	Surface;

typedef struct tagPivot
{
	Vertex	point;
	S16		parentindex;
	U16		vertexcount;
} Pivot;

typedef struct tagGoraudColor
{
	U8	cr[4],cg[4],cb[4];
}	GoraudColor;

typedef struct tagFlatColor
{
	U8	cr,cg,cb;
	U8	padding;
}	FlatColor;
=============================================================

	dog file size description.

=============================================================
_DGO_HEADER	header
header.ImageCount * 128
header.SurfaceCount * sizeof(Surface)
header.VertexCount * sizeof(Vertex)
header.FaceCount * sizeof(Face)
header.PivotCount * sizeof(Pivot)
switch( header.ShadeType )
{
case 0:	0
case 1:	header.VertexCount * sizeof(Vertex)
case 2: header.FaceCount * sizeof(Vertex)
case 3:	header.FaceCount * sizeof(GoroudColor)
case 4: header.FaceCount * sizeof(FlatColor)
}
=============================================================

	dog file format.

=============================================================
1. Header
	dgo file    ִ κ.

	S32 Version;		//	version information. ( 0x0010 )
	S32 ImageCount;		//	image file .
	S32 SurfaceCount;	//	surface() .
	S32 VertexCount;	//	 vertex .
	S32 FaceCount;		//	 face .
	S32 PivotCount;		//	pivot 
	S32 ShadeType;		//	shde type

2. Image filename list
	dgo ϱ ʿ image filename list
	filename 128byte ϹǷ  κ ũ
	( header.ImageCount * 128 ) ̴.
	dgoSurface.exe ̿  Ҽ ִ.

3. Surface list
	dgo Ǵ  list.
	face   ϰ ȴ.
	
	U8	r, g, b;	
		texture   facecolor		
	U8	a;			
		alpha option   alpha
	S16	imageindex;	
		texture  Image filename list index
		texture   -1 ̴.
	U16	drawoption;
		face ׸  ɼ.
		  or  .
		ALPHA			0x0001
		ZBUFFER			0x0002
		SHADE			0x0004
		TEXTURE			0x0008
		FOG				0x0010
		TRANSPARENCY	0x0020
		PERSPECTIVE		0x0040
		FILTER			0x0080
		LAMPALPHA		0x0100
		DOUBLESIDE		0x1000

		[]
		ALPHA     : ( screencolor*(255-alphavalue) + sourcecolor*alphavalue )/255
		LAMPALPHA : ( screencolor*(255           ) + sourcecolor*alphavalue )/255

	U32	faceCount;
		dgo file  face surface ĵǾִ.
		  surface ϰ ִ face ̴.

4. vertex list


5. face list
	 ٰ   'numvertex' ׸ ־ 
	  ο  'ﰢ'( 3ds ﰢ  )
	̸鼭 'װ'   ִ.
	 ̻ ̱   簢  
	𸣰 ؼ, c structure ׳ о
	Ⱚ ä־.

	U32	numvertex;	
		face vertex.  3.
	U16	vertex[4];	
		vertex index. 3 ǹ̰ .
	float u[4],v[4];
		texture ǥ.  3 ǹ̰ .
		texuture  ʾƵ Ⱚ ä .

6.	Pivot list
	pivot 0  ִϸ̼   
	  ϰ  ȿ  κ .
	lws dgoMaker 'Animation'  üũؾ߸ pivot 
	dgo file exportȴ. 
	Pivot  Ʈ   Ǹ 
	ִϸ̼ǽ ȴ.

	Vertex	point;
		Pivot ġ.
	S16	parentindex;
		Parent pivot index.
		-1ϰ ֻ Pivot ̴.
	U16	vertexcount;
		 vertex  ڽ  Pivot־ Pivot
		Matrix Ŀ  vertex ϰ Ǿִ.
		̸ ϰ ϱ dgo Vertex list Pivotȣ
		 ĵǾ.
		  Pivot  vertex ̴.

7.	ShadeType  .

	Shade Type
	-----------------------------------------
    case 0:
	   No shading 
       ϳ ̸ rgb÷ normal  .
	case 1:
       Real time goroud shading
       ϳ vertex normal ϴ .
	case 2:
	   Real time flat shading
	   ϳ face normal ϴ .
	case 3:
       precalculated goroud shading
       lws ϳ light object ؼ  rgb. 
	   ︶  ŭ rgb ´.
	      4̹Ƿ   
	   faceŭ Ѵ.
		typedef struct tagGoraudColor
		{
			U8	cr[4],cg[4],cb[4];	// 3 ȿ.
		}	GoraudColor;
		
	case 4:
       precalculated flat shading
       lws ϳ light object ؼ  rgb. 
	   ︶ ϳ rgb ´.
	     face ŭ Ѵ.
		typedef struct tagFlatColor
		{
			U8	cr,cg,cb;
			U8	padding;	// 4Ʈ  ..
		}	FlatColor;

=============================================================
	PS.
=============================================================
̰  3d ϸ鼭 ʿ信   format Դϴ.

format Ư¡
 - Ű ִϸ̼  (pivot) ԵǾְ,
 -  ӵ   face surface ĵǾ,
 - ִϸ̼ matrix vertex    
    vertex pivot ĵǾֽϴ.

и ̰   format ƴ, dgo ȯ, 
 ,  Ϻ մϴ.

  ¥ٺ Ϻȯ  ϴ ð 
ûٴ  ƽǰ̴ϴ.
̰   ̳ 帱  ڴٴ 
   ̺귯 Ǳ⵵  ̷
   ÷帳ϴ.

fileformat  ñ ôٰų,  ڴٴ
κ ø   ֽʽÿ.
ǰ ݿؼ  3d file format ؼ, tool
 帮 ϰڽϴ.

hitel ID : Gamza
E-mail	 : Gamza@hitel.net
