#  DFto3DS Help Index

How To ...
	Basic Use
	Contact the Author
	Arch3D.BSA File Format

Main Window
	Object List
	Object Value
	Object Offset
	Object Size
	Version
	Point Count
	Face Count
	Data2 Count
	Point Offset
	Face Offset
	Normal Offset
	Data1 Offset
	Data2 Offset

Commands
	File menu
	View menu
	Help menu

#K $ File menu commands

The File menu offers the following commands:

Open	Opens an existing ARCH3D.BSA file.	
Export 3DS	Saves the currently displayed 3D object to a 3DS (3D-Studio version 3) file.	
Export DXF	Saves the currently displayed 3D object to a DXF (AutoCad) file.	
Export All 3DS	Attempt to export all the 3D objects in ARCH3D.BSA to 3DS files	
Exit	
	Exits the DFto3DS application.	

#View menu commands

The View menu offers the following commands:

Toolbar	Shows or hides the toolbar.	
Status Bar	Shows or hides the status bar.

#Help menu commands

The Help menu offers the following commands, which provide you assistance with this application: 

Help Topics	Offers you an index to topics on which you can get help.	
Contents	Displays the main help contents page for the application.	
About	Displays the version number of this application.	

#K $ Open command (File menu)

Use this command to open an existing ARCH3D.BSA file, usually located in Daggerfall's ARENA2 directory.  You must open an ARCH3D.BSA file to view and export the 3D object the file contains.

Shortcuts
Toolbar:	{bmc fileopen.bmp}
Keys:	CTRL+O

#File Open dialog box

The following options allow you to specify which file to open:
File Name
Type or select the filename you want to open.  This box lists files with the extension you select in the List Files of Type box. 
List Files of Type
Select the type of file you want to open.  This has to be a ARCH3D.BSA type file otherwise an error will occur.

# K $ 1, 2, 3, 4 command (File menu)

Use the numbers and filenames listed at the bottom of the File menu to open the last four ARCH3D,BSA documents you used.  Choose the number that corresponds with the document you want to open.

#K $ Exit command (File menu)

Use this command to end your DFto3DS session.

Shortcuts
Mouse:	Double-click the application's Control menu button.
	{bmc appexit.bmp}
Keys:	ALT+F4

#K $ Toolbar command (View menu)

Use this command to display and hide the Toolbar, which includes buttons for some of the most common commands in DFto3DS, such as File Open.  A check mark appears next to the menu item when the Toolbar is displayed.

See Toolbar for help on using the toolbar.

#K $ Toolbar
{bml hlptbar.bmp}

The toolbar is displayed across the top of the application window, below the menu bar.  The toolbar provides quick mouse access to many tools used in DFto3DS,

To hide or display the Toolbar, choose Toolbar from the View menu (ALT, V, T).

Click	To
{bmc fileopen.bmp}	Open an existing ARCH3D.BSA file. DFto3DS displays the Open dialog box, in which you can locate and open the desired file.

#K $Status Bar command (View menu)

Use this command to display and hide the Status Bar, which describes the action to be executed by the selected menu item or depressed toolbar button, and keyboard latch state. A check mark appears next to the menu item when the Status Bar is displayed.

See Status Bar for help on using the status bar.

#K $Status Bar
{bml hlpsbar.bmp}

The status bar is displayed at the bottom of the DFto3DS window.  To display or hide the status bar, use the Status Bar command in the View menu.

The left area of the status bar describes actions of menu items as you use the arrow keys to navigate through menus.  This area similarly shows messages that describe the actions of toolbar buttons as you depress them, before releasing them.  If after viewing the description of the toolbar button command you wish not to execute the command, then release the mouse button while the pointer is off the toolbar button.

The right areas of the status bar indicate which of the following keys are latched down:

Indicator	Description
CAP	The Caps Lock key is latched down.
NUM	The Num Lock key is latched down.
SCRL	The Scroll Lock key is latched down.

#Contents command (Help menu)

Use this command to display the opening screen of Help.  From the opening screen, you can jump to step-by-step instructions for using DFto3DS and various types of reference information.  

#Topics command (Help menu)

Use this command to display the list of available help topics.

#Using Help command (Help menu)

Use this command for instructions about using Help.

#About command (Help menu)

Use this command to display the copyright notice and version number of your copy of DFto3DS.

#$Context Help command 
{bml curhelp.bmp}

Use the Context Help command to obtain help on some portion of DFto3DS.  When you choose the Toolbar's Context Help button, the mouse pointer will change to an arrow and question mark.  Then click somewhere in the DFto3DS window, such as another Toolbar button.  The Help topic will be shown for the item you clicked.

Shortcut
Keys:	SHIFT+F1

#Title Bar

The title bar is located along the top of a window.  It contains the name of the application and document.

To move the window, drag the title bar.  Note: You can also move dialog boxes by dragging their title bars.

A title bar may contain the following elements:
{bmc bullet.bmp}	Application Control-menu button
{bmc bullet.bmp}	Document Control-menu button
{bmc bullet.bmp}	Minimize button
{bmc bullet.bmp}	Name of the application
{bmc bullet.bmp}	Name of the document
{bmc bullet.bmp}	Restore button

#Move command (Control menu)

Use this command to display a four-headed arrow so you can move the active window or dialog box with the arrow keys.
{bmc curarw4.bmp}

Note:  This command is unavailable if you maximize the window.

Shortcut
Keys:	CTRL+F7

#$Minimize command (application Control menu)

Use this command to reduce the DFto3DS window to an icon.

Shortcut
Mouse:	Click the minimize icon {bmc scmin.bmp} on the title bar.
Keys:	ALT+F9

#Switch to command (application Control menu)

Use this command to display a list of all open applications.  Use this "Task List" to switch to or close an application on the list.

Shortcut
Keys:	CTRL+ESC

Dialog Box Options
When you choose the Switch To command, you will be presented with a dialog box with the following options:
Task List
Select the application you want to switch to or close.
Switch To
Makes the selected application active.
End Task
Closes the selected application.
Cancel
Closes the Task List box.
Cascade
Arranges open applications so they overlap and you can see each title bar.  This option does not affect applications reduced to icons.
Tile
Arranges open applications into windows that do not overlap.  This option does not affect applications reduced to icons.
Arrange Icons
Arranges the icons of all minimized applications across the bottom of the screen.

#No Help Available

No help is available for this area of the window.

# File Menu - Export 3DS

Select this menu to export the currently displayed 3D object from the ARCH3D.BSA file to a version 3.0 3DS file (3D Studio file).  This file can then be imported into many 3D CAD and modeling programs and manipulated.  The object is currently exported with no texture information, just a plain shape.  The object scale is 1000 times smaller than that used in Daggerfall in order to produce 3D objects appropriate for import into typical modeling programs.

3DS files now support the exporting of Daggerfall textures with the object.  In addition to the 3DS file, several BMP texture files will also be export.  When importing the object into 3D Studio (or similar programs) the application may be need to be aware of the BMP path, or the BMP may have to be copied into a special directory.  The BMP file name is of the format:  DFxxxyyy.BMP where XXX is the texture index (000 to 511) and yyy is the texture sub-image index (0 to 127).  Solid color textures (texture files 000 and 001) do not require a BMP file.

# File Menu - Export DXF

Select this menu to export the currently displayed 3D object from the ARCH3D.BSA file to a DXF file (AutoCad file).  This file can then be imported into many 3D CAD and modeling programs and manipulated.  The object is currently exported with no texture information, just a plain shape.  The object scale is 1000 times smaller than that used in Daggerfall in order to produce 3D objects appropriate for import into typical modeling programs.  Note that some programs may not properly import the object as a closed 3D mesh.

# 3D Object List

This list displays all the 3D objects contained in the currently loaded ARCH3D.BSA file.  The list displays the object value IDs which identify the object, and the object size in kilobytes.  Scroll down the list and select items to display their basic information in the text fields on the right side of the object list.  Right-clicking on the selected list item displays a context menu for commonly used commands.

# Object Value

The 3D objects contained within an ARCH3D.BSA files are identified by a 5 byte long integer, the object value (which should be unique but some values reoccur a few times).  The value is displayed in base-16, hexadecimal notation.

# Object Size

The object size text box displays the size the 3D object occupies in the ARCH3D.BSA file in bytes.  The size is displayed in regular base-10 and hexadecimal notation.

# Object Offset

The object offset text box displays the offset of the 3D object in the ARCH3D.BSA file.  The offset is displayed in base-16, hexadecimal notation.

# Object Version

The object version text box displays the version number for the 3D object.  Most objects are v2.7 while a few are v2.6 and even fewer are v2.5.

# Object Point Count

The object point count text box displays the number of points contained in the 3D.  Each point is composed of a 4 byte floating point X, Y, and Z coordinate.
 
# Object Point Offset

The object point offset text box displays the offset to the start of the point data relative to the start of the 3D object.  The offset is displayed in regular base-10 and base-16 hexadecimal notation.

# Object Face Offset

The object face offset text box displays the offset to the start of the face data relative to the start of the 3D object.  The offset is displayed in regular base-10 and base-16 hexadecimal notation.

# Object Normal Offset

The object normal offset text box displays the offset to the start of the normal data relative to the start of the 3D object.  The offset is displayed in regular base-10 and base-16 hexadecimal notation.  Note that it is not yet confirmed if the normals section really represents the face normals.

# Object Data1 Offset

The object data1 offset text box displays the offset to the start of the data1 section relative to the start of the 3D object.  The offset is displayed in regular base-10 and base-16 hexadecimal notation.  Note that the purpose of the data1 section is unknown.

# Object Data2 Offset

The object data2 offset text box displays the offset to the start of the data2 section relative to the start of the 3D object.  The offset is displayed in regular base-10 and base-16 hexadecimal notation.  Note that the purpose of the data2 section is unknown.

# Object Face Count

The object face count text box displays the number of faces contained in the 3D.  Each face is composed of texture information, options, and the point indices which make up the face.  Faces in Daggerfall can contain anywhere from 3 to 24 points.
 
# Object Data2 Count

The object data2 count text box displays the number of data2 sections contained in the 3D.  The data contained in the data2 section is unknown.

# File Menu - Export All 3DS

Attempts to export all the 3D objects to 3DS files to a chosen directory. . This will create approximately 11,000 3DS and BMP files totaling 40 MB in the chosen path and will take several minutes depending on your computer’s speed.  Currently around 97% of the 10000+ 3D objects can be exported correctly.  The additional 3% can be exported but have visisble defects with their textures. 
# Basic Use of DFto3DS

The DFto3DS application can be used to load and display information on the ARCH3D.BSA files used by the computer role playing game The Elder Scrolls Chaper 2:Daggerfall.  The ARCH3D.BSA files contain more than 10,000 of the basic 3D objects which make up the game.  DFto3DS can load the BSA file and display information on each of these 3D objects.  The objects can also be exported to a simple AutoCad DXF or 3D Studio 3DS file for use in many CAD or modeling programs.  Textures are only supported when exporting to 3DS files (extra BMP files are created in addition to the 3DS file).

This program is an unofficial program and is in no way connected with Bethesda Softworks, the game publishers (www.bethsoft.com).

If you experience any problems with the program, please feel free to contact me at uesp@m0use.net for help or information.

Note:  There are two objects (numbered 4723 and 7615) that contain errors and cannot be loaded by the program.  An additional 3% of objects have some problems with their textures due to problems with texture coordinates (which should be fixed shortly).

# Contact the Author

Please feel free to contact me for any problems encountered with this program or for more information:

E-Mail:		uesp@m0use.net
Web: 		http://www.m0use.net/~uesp/
 
# ARCH3D.BSA File Format

The following description has been tested on all the 3D Objects contained in Arch3D.BSA and appears to be sound.  There are two records which have some problems (offsets 0x008B8D58 and 0x013274C6) and don't follow the known format of the other 10249 records.  They have a large section of repeating bytes just after the 3D object header and their Data2 section is not the standard.  These records could very well be corrupt or not used or of a special, undiscovered, format.

    General File Layout
  -------------------------------------
    The file is a typical BSA file with a 0x0200 directory at the end. Each BSA record contains the information for one 3D object.

BSA Header
...3D Object Records...
Object Directory

    BSA Header
  -------------------------------------  
This is the first 4 bytes found at the start of a BSA file and gives information about the BSA directory at the end of the file. 

	[Bytes 0-1] short DirectoryCount;
		Gives the number of entries in the directory at the end of the file.
	[Bytes 2-3] short DirectoryType; 
		Gives the type of directory at the end of the BSA file.  There are 10251
		(0x280B) records in the standard ARCH3D file.
			0x0100 = Directory has records of 18 bytes in size
				 consisting of a 14 byte filename and a long
				 record length.
			0x0200 = Directory has records of 8 bytes in size
				consisting of long ID and a long record size.  The ARCH3D
				file is of this type.

    3D Object Records
  -------------------------------------
Each BSA record contains the information for one 3D object. Note that each record appears to be _similar_ to the .3D file format used in Battlespire.  One difference is that here the .3D files are contained in one big file,  while in Battlespire they are in individual files. Records range from 212
to 81394 bytes in size.  The basic record layout is as follows:

	3D Object Header (64 Bytes)
		Always the first 64 bytes in the record.  See the header
		section below for detail format and information.
	Unknown Data		
		Two files have strange sections of repeating bytes between
		the record header and point data. Usually, though, the point
		data follows starting at byte 64.
	Point Data
		Contains the point data as given by the number of points 
		previously read.  Each point is composed of 3 signed long
		integers, (X, Y, Z) for 12 bytes per point. Use the PointOffset
		variable in the header to get the start of the point data.
	PlaneData
		See the Plane Data Record section below.  There is one record
		for each plane given by the PlaneCount variable.  Use the
		PlaneOffset variable in the header to get the start of the
		plane data.
	Normal? Data Section
		Appears to have XYZ 12 bytes triplets again with the number of
		records equal to the number of planes.  This appears to be the
		normals of the planes but not entire confirmed. The offset to
		this data is also in the header.
	 Data1 Section
		This section is usually all 0x00's, but the size indicates it
		should have a record size of 24 bytes with the number of
		records equal to the number of planes. The offset to the start
		of this data is also in the header.
	Data2 Section
		The number of records in this section is given in the object
		header.	The basic format of each record is as follows:
		   [Bytes 0-15]		long Numbers[4];
			Looks like 3 or 4 coordinates.
		   [Bytes 16-17]	short NumSubRecords;
			Gives the number of 6 bytes sub-records which follow.
		   [Bytes 18...]	char SubRecords[6][]
			The variable number of sub record data.
		This data finishes off the object record data.  The offset
		to the start of this data and the number of records the section
		contains is in the object header.

Note that while most 3D objects have this format, some have the sections mixed up slightly (i.e., the data1 section comes before the points).  One should use the offset information in the object header to determine where each section starts.

    3D Object Header
  -------------------------------------
    The header is always the first 64 bytes in a 3D object record.

    	[Bytes 0-3]	char Version[4] = "v2.7"; (or "v2.6" or "v2.5")
		Appears to be a version number or record identifier. Most of
		the records have v2.7, though 135 have v2.6 and 9 have v2.5.
		Note that the trailing NULL character is not included.  It is
		currently unknown what differences the various version records
		have, although it appears to be minor.
	[Bytes 4-7]	long PointCount;
		Gives the number of points contained in the 3D object.  Each
		point consists of 3 long integers (X, Y, Z) for a total of 
		12 bytes per point.  Point counts range from 3 to 1010.
	[Bytes 8-11]	long PlaneCount;
		This gives the number of planes/faces in the 3D object. Plane
		counts range from 1 to 712.
	[Byte  12-15]	long Unknown1;
		Has a wide range of values, generally non-zero.
	[Bytes 16-23]   char NullValue1[8];
		Always 0x00 bytes (confirmed).
	[Bytes 24-27]	long Data1Offset;
	[Bytes 28-31]	long Data2Offset;
		Appear to be offsets from the start of an object record
		Offset1 is always non-zero and Offset2 is zero only 3 times
		(confirmed).
	[Bytes 32-35]	long NumData2Records;
		Usually non-zero and less than 0x0010 (maximum around 212).
		Appears to be the number of records pointed to by Offset2.
	[Bytes 36-37]	short Unknown3;
		A wide range of repeating values.
	[Bytes 38-39]	short Unknown4;
		Usually 0x0000 or less than 0x0010 (maximum of 0x0068).
	[Bytes 40-43]	long NullValue3;
	[Bytes 44-47]	long NullValue4;
		Always 0x00000000 (confirmed).
	[Bytes 48-51]	long PointOffset;
		Almost always 0x00000040 but also takes on the values
			0x00000000 (strange?)
			0x00000178
			0x00001510
			0x000017F8
		The offset from the start of the object record to the start of
		the point data.
	[Bytes 52-55]	long NormalOffset;
		Offset from the record origin to the next byte after the end of
		the plane data. Always non-zero (confirmed).
	[Bytes 56-59]	long Unknown6;
		Always 0x00000000 except for 19 records which it has a number
		of values from 0x000000F4 to 0x000001FC. Possibly offset?
	[Bytes 60-63]   long PlaneOffset;
		Offset from start of object to the plane/face data.

    Plane Data Record Section
  -------------------------------------
This is a sub-record of the 3D Object Record. Each plane record is  (8 + (PlanePointCount*8)) bytes in size. Some of the variables are bit fields written out as [Bytes 2-3.1] which would be a 9 bit field.
    
	[Byte 0]	unsigned char PlanePointCount; (8 bits)
		The number of points which makes up the plane. This value
		ranges from 0x00 to 0x18 (24).
	[Byte 1]	char Unknown1;	(8 bits)
		Usually 0x00 for most plane records (about 2% are non-zero).
		Values range from 0x00 to 0xFF although most are repeating 
		values in the 0x00 to 0x40 range.
	[Bytes 2-2.6]	unsigned short SubImageIndex;	(7 bits)
		The subimage index in the texture file (0 to 127).
	[Bytes 2.7-3.7]	unsigned short TextureIndex;	(9 bits)
		The texture file index (0 to 474). 
	[Bytes 4-7] 	long Unknown4;
		Almost always 0x00000000, 0x00010000, 0x00010001, or 0x00010002 
		and rarely a wide range of other values.  Probably two short 
		values.
	[Bytes 8...]	PlanePointSubRecords
		For each point in the PlanePointCount variable, there is 8 bytes
		of data.
			[Bytes 0-3] 	long PointOffset;
			   v2.7:This gives the offset of the point used from the
				beginning of the point data. In other words,
				divide by 12 to get the point index. This is 
				confirmed for all v2.7 objects except for one
				which is strange (offset 0x013274C6).
			   v2.6:Appears to be the same as v2.7.
			   v2.5:The point offset is a multiple of 4 and appears
				to be the offset to the actual XYZ coordinate
				of the point.  To get the point index, divide
				by 4 (unconfirmed).
			[Bytes 4-5]	short TextureU;
			[Bytes 6-7]	short TextureV;
				The UV texture coordinates for this point.  See the
				Appendix further down for more information.

      BSA 0x0200 Directory (Number)
  -------------------------------------
The 0x0200 type directory consists of records 8 bytes in size and give a record size and long identifier for each BSA record (10251 records in an ARCH3D file).
	
	[Bytes 0-3] long RecordID;
		A long number which assumbly identifies the record somehow.  In the
		ARCH3D file all but 25 records have unique values.
	[Bytes 4-7] long DataSize;
		The size of the data in bytes.  The first entry starts at 
		offset 4 in the file, ignoring the 4 bytes of the BSA Header.
		The subsequent section offsets can be calculated from this.

    Special Objects
  -------------------------------------
    The following list of objects in the ARCH3D file have special mention.

	Object 4722 (0x8B8D58)
		This v2.6 3D object has a truncated, or different, Data2
		section which does not conform with the known format.
	Object 7614 (0x13274C6)
		This v2.7 object has an invalid offset to the Data2
		section (it points to the middle of the data1 section).

Appendix - UV TEXTURE COORDINATES
======================================
  Daggerfall handles UV coordinates a little differently than most 3D programs
  and require some explanation.  The TextureU and TextureV in the plane sub-
  records hold the texture coordinate data for the face point but, depending
  on the face, the UV coordinates have different meaning:

	Point 1: The actual DfUV coordinate for that point.
	Point 2: The change in DfUV coordiantes relative to Point 0.  To get
		 the absolute DfUV values you must add Point 1s to Point 0.
	Point 3: The change in DfUV coordiantes relative to Point 1.  To get
		 the absolute DfUV values you must add Point 2s to Point 1
		 and 0.
	Point 4: For faces with more than 3 points, this point is the absolute
		 DF UV coordinate for that point.  Tests seem to indicate,
		 though, that the game does not use this data.
	Point 5+:UV coordinates should be all 0 and are not used.

  Since all points on the face after the 4th have no UV values, this indicates
  that we must find a relationship between the XYZ point and the UV coordinate,
  which is detailed below.

  The units of DfUV texture coordinates are relative to the size of the texture
  image.  A value of 1024 represents 64 pixels of image data. The conversion
  between DfUV and standard UV coordinates is detailed below.

    CONVERTING XYZ to UV Coordinates
  -------------------------------------
  Unfortunately, as of this point, there is no simple way to compute the UV
  coordinate of a point from its XYZ location, but the best current method is
  explained as follows.  We first assume that the relationship is linear and
  of the form:
		U = aX + bY + cZ + d
		V = eX + fY + gZ + h
  
  Since all faces have at least 3 points (confirmed) and we know the UV
  coordinates for the first 4 points, we should be able to solve for the 
  parameters a...h. We assume d and h are both 0 for this case, though we
  will use them later.  We could solve for the 6 unknowns explicitly but we
  would have to take into account which points have similar XYZ coordinates 
  which becomes messy (we can't divide by X1-X2 if they are equal).  Instead, 
  we will take the similar route of expressing the equations in matrix form
  and solving the matrix equation (which may turn out to be just as complex).
  The matrix equation for U is of the form:

	{ X1 Y1 Z1 }   { a }   { U1 }
	{ X2 Y2 Z2 } * { b } = { U2 }
	{ X3 Y3 Z3 }   { c }   { U3 }

  where X1,Y1,Z1,U1 and the coordinates of the first points.  To solve for
  the unknown matrix {a..c} we simple need the inverse of the {X1...Z3} matrix
  which will be multiplied to left of the {U1..U3} matrix.  Using the Jacobian
  method of matrix inversion we can find the solution to be:

		/* Compute the determinant of the XYZ matrix */
	Determinant = X1*Y2*Z3 + Y1*Z2*X3 + Z1*X2*Y3 - X3*Y2*Z1 - X2*Y1*Z3 - X1*Y3*Z2
	
		/* Compute the inverse of the XYZ matrix */
	Xi1 = ( Y2*Z3 - Y3*Z2) / Determinant
	Xi2 = (-X2*Z3 + X3*Z2) / Determinant
	Xi3 = ( X2*Y3 - X3*Y2) / Determinant

	Yi1 = (-Y1*Z3 + Y3*Z1) / Determinant
	Yi2 = ( X1*Z3 - X3*Z1) / Determinant
	Yi3 = (-X1*Y3 + X3*Y1) / Determinant

	Zi1 = ( Y1*Z2 - Y2*Z1) / Determinant
	Zi2 = (-X1*Z2 + X2*Z1) / Determinant
	Zi3 = ( X1*Y2 - X2*Y1) / Determinant

		/* Compute the DfUV conversion parameters */
  	a = U1*Xi1 + U2*Yi1 + U3*Zi1
	b = U1*Xi2 + U2*Yi2 + U3*Zi2
	c = U1*Xi3 + U2*Yi3 + U3*Zi3
	d = 0

	e = V1*Xi1 + V2*Yi1 + V3*Zi1
	f = V1*Xi2 + V2*Yi2 + V3*Zi2
	g = V1*Xi3 + V2*Yi3 + V3*Zi3
	h = 0

  This works for more than 90% of the 10251 objects in the ARCH3D.BSA files,
  but it fails when the Determinant above is 0.  This usually occurs when all
  of the points on a face lie in the X=0, Y=0, or Z=0 plane.  In these cases
  we must use the d and h parameters which were previously assumed to be zero.
  For example, in the case where all Y=0, the equations turn into:

	U = aX + cZ + d
	V = eX + gZ + h

  as b and f are irrelevant due to Y=0.  The matrix solution then becomes:

	{ X1 1 Z1 }   { a }   { U1 }
	{ X2 1 Z2 } * { d } = { U2 }
	{ X3 1 Z3 }   { c }   { U3 }

	Determinant = X1*Z3 + Z2*X3 + Z1*X2 - Z1*X3 - X2*Z3 - X1*Z2

	Xi1 = ( Z3 - Z2) / Determinant
	Xi2 = (-X2*Z3 + X3*Z2) / Determinant
	Xi3 = ( X2 - X3) / Determinant

	Yi1 = (-Z3 + Z1) / Determinant
	Yi2 = ( X1*Z3 - X3*Z1) / Determinant
	Yi3 = (-X1 + X3) / Determinant

	Zi1 = ( Z2 - Z1) / Determinant
	Zi2 = (-X1*Z2 + X2*Z1) / Determinant
	Zi3 = ( X1 - X2) / Determinant
	
	a = U1*Xi1 + U2*Yi1 + U3*Zi1
	b = 0
	c = U1*Xi2 + U2*Yi3 + U3*Zi3
	d = U1*Xi2 + U2*Yi2 + U3*Zi2

	e = V1*Xi1 + V2*Yi1 + V3*Zi1
	f = 0
	g = V1*Xi3 + V2*Yi3 + V3*Zi3
	h = V1*Xi2 + V2*Yi2 + V3*Zi2

  using similar equations for the case of X=0 and Z=0, we can successfully
  convert XYZ coordinates to DfUV texture coordinates for about 97% of the 
  Arch3D objects.  This still leaves arounds 270 objects where the XYZ
  determinant is zero.  This means we may have to solve for 4 points instead
  of only the first 3, which becomes much more complicated.

  To convert from DfUV coordinates (computed above) into 'normal' UV, the
  following equations can be used:

	NU = (aX + bY + cZ + d) / (16 * TextureWidth)
	NV = (eX + fY + gZ + h) / (16 * TextureHeight)

  Normal UV coordinates are based on a value of 1.0 equaling the texture
  width or height and are usually used in 3D modelling programs.  These
  equations appear to give the correct texture coordinates for most 3D
  objects.
 
# Main Window

The main window of DFto3DS contains information about the currently loaded ARCH3D.BSA file and the currently selected 3D object from that file.

Main Window Controls
	Object List
	Object Value
	Object Offset
	Object Size
	Version
	Point Count
	Face Count
	Data2 Count
	Point Offset
	Face Offset
	Normal Offset
	Data1 Offset
	Data2 Offset