XGL File Format Specification

The XGL file format is designed to represent 3D information for the purpose of visualization. It attempts to capture all of the 3D information that can be rendered by SGI's OpenGL rendering library. It uses XML 1.0 syntax, so it is easy to write and can be parsed by standard, freely available code. These features make XGL the ideal format to use when data must be exchanged between two graphics systems for the purposes of visualization.

The XGL format is intended to work well with systems that use OpenGL. It should be possible to take a program that renders 3D information using OpenGL and have that program export an XGL file. Then, an XGL viewer should be able to create OpenGL objects that are exactly the same as those rendered by the exporting program.

Because the XGL format uses XML syntax, it is easy to write applications that read and write XGL. To export XGL, an application needs only write out a text file using the XML syntax. XGL supports a variety of mechanisms for arranging and referencing data within the file, so it should be easy to find a method of exporting data that is easy to implement for any graphics system. There are a number of free XML parsers available, eliminating the need to implement a complex parser when building an XGL reader.

XML Syntax

The World Wide Web Consortium defines XML syntax. Detailed information about this syntax can be found at http://www.w3.org/TR/REC-xml. XGL uses a fairly basic subset of XML. In XGL, the order of tags within another tag is irrelevant. Any tags that are not defined are reserved for future versions of XGL except for those that begin with "EXT". Any application specific data should be enclosed with a tag that begins with "EXT".

Referencing

XGL supports the sharing of data between different parts of a file. For example, a vertex that is part of several faces can be defined once and can then be referenced by the faces that include that vertex. Referencing allows an XGL reader to recognize that two objects are the same. It also leads to a more compact file format.

Referencing is implemented by allowing certain XGL tags to contain an attribute named "ID" whose value is an integer. In other parts of the file another tag of the form <tagREF> can reference that value that is defined by the "ID" attribute. The places in a file where elements can be defined are indicated in the "Available Defines" sections of this documentation. A defined element can be referenced from anywhere within its parent or any of its parent's descendents.

Vectors

There are many places in XGL where vectors are used. A vector could be represented with a XML tag for each dimension of the vector, but this approach often leads to extremely large files because of the extra space used to store the tags. For this reason, XGL represents vectors as numbers delimited by commas. Specifically, XGL currently uses two, three, four and six dimensional floating-point vectors.


XGL Tag Definitions

Top-Level Tags

<WORLD>

The <WORLD> tag represents all of the viewer independent elements of a scene. This includes 3D objects, lights, and environment information.

Required Elements
Lighting

Exactly one element from the "Lighting Tags" section is required.

Background

Exactly one element from the "Background Tags" section is required.

Optional Elements
Object

Any number of tags from the "Object Tags" section may be added here. A world with sub-objects may not have a mesh.

Mesh

The <WORLD> tag may contain up to 1 tag from the "Mesh Tags" section.

Name

The <WORLD> tag may contain up to 1 tag from the "Name Tags" section.

Available Defines
<OBJECT>
<MESH>
<MAT>
<LINESTYLE>
<POINTSTYLE>
<TEXTURE>
<TEXTURERGB>
<TEXTURERGBA>
<TC>

Object Tags

<OBJECT>

The <OBJECT> tag represents a 3D object at a specific location in the world. An object may have other objects within it. It may also have data associated with it. The object tag may include an attribute named "PATHID" which should be a positive integer. This attribute can be used to identify a particular object instance within the object hierarchy. The "PATHID" attribute must be unique within the children of a parent.

Optional Elements
Mesh

The <OBJECT> tag may contain up to 1 tag from the "Mesh Tags" section.

Transform

The <OBJECT> tag may contain up to 1 tag from the "Transform Tags" section. This transform is used to map the mesh into the space of the parent tag. If this tag is not included, the identity transform is used.

Objects

The <OBJECT> tag may contain any number of tags from the "Object Tags" section may be added here. Objects included here will be transformed into this object's space. An object with sub-objects may not have a mesh.

Data

The <OBJECT> tag may contain any number of tags from the "Data Tags" section.

Name

The <OBJECT> tag may contain up to 1 tag from the "Name Tags" section.

Available Defines
<MESH>
<MAT>
<LINESTYLE>
<POINTSTYLE>
<TEXTURE>
<TEXTURERGB>
<TEXTURERGBA>
<TC>

<OBJECTREF>

This tag must contain an integer that corresponds to the "ID" attribute of an <OBJECT> tag that is defined in the current scope.

<INCLUDE>

This tag represents a reference to an external XGL file. The external file does not have to be present to view the parent file. The <INCLUDE> tag may include an attribute named "PATHID" which should be a positive integer. This attribute can be used to identify a particular object instance within the object hierarchy.

Required Tags
<EXTENTS>

This tag must contain exactly one 6D Vector. This vector represents the minX, minY, minZ, maxX, maxY, maxZ of the points in world space of the external XGL file linked in.

<REF>

This tag must contain exactly one path to another XGL file. The <REF> tag is not designed to explicitly state how another XGL file is found, but rather relies on the user of XGL to determine how to find the file given this context-free path. This allows for a great flexibility in where and how the data for this <INCLUDE> is obtained.

<REFTYPE>

This tag contains a string key that indicates how the data in the <REF> path is interpreted. Some standard Ref Types have been defined, but any type may be defined by using the prefix "EXT" before the type name.

Optional Tags
Transform

The <INCLUDE> tag may contain up to 1 tag from the "Transform Tags" section. This transform is used to map the included object into the space of the parent tag. If this tag is not included, the identity transform is used.

Data

Any number of tags from the "Data Tags" section may be added here. These tags represent data that is associated with the included object.

Name

The <INCLUDE> tag may contain up to 1 tag from the "Name Tags" section. This name represents the name of this instance of the external XGL file.

<INCLUDESTATIC>

This tag also represents a reference to an external XGL file. The external file needs to be present in order to view the referencing file. The <INCLUDESTATIC> tag may include an attribute named "PATHID" which should be a positive integer. This attribute can be used to identify a particular object instance within the object hierarchy. Since we can count on the external file being there, the extents of the included file can be determined from the included file.

Required Tags
<REF>

This tag must contain exactly 1 path to another XGL file. The <REF> tag is not designed to explicitly state how another XGL file is found, but rather relies on the user of XGL to determine how to find the file given this context-free path. This allows for a great flexibility in where and how the data for this <INCLUDESTATIC> is obtained.

<REFTYPE>

This tag contains a string key that indicates how the data in the <REF> path is interpreted. Some standard Ref Types have been defined, but any type may be defined by using the prefix "EXT" before the type name.

Optional Tags
Transform

The <INCLUDESTATIC> tag may contain up to 1 tag from the "Transform Tags" section. This transform is used to map the included object into the space of the parent tag. If this tag is not included, the identity transform is used.

Data

Any number of tags from the "Data Tags" section may be added here. These tags represent data that is associated with the included object.

Name

The <INCLUDESTATIC> tag may contain up to 1 tag from the "Name Tags" section. This name represents the name of this instance of the external XGL file.

Ref Types

FILE

The Ref Type FILE specifies a '/' delimited file path. If the ref begins with '/' it is an absolute path. If the ref does not begin with a '/' the path is relative to the location of the file that the ref is in. Files can contain any ASCII character between 0x20 and 0xFF, with the exception of '\', '/', '*', '?', '"', '<', '>', and '|'. Files are case sensitive.

EXT

Ref Types that begin with EXT are extension Ref Types and can be used for whatever purpose. This specification will never include a Ref Type beginning with EXT.

 

Name Tags

<NAME>

This tag is used to describe a displayable name for an object or world. This tag may contain any number of XML characters and must not contain any other XGL tags.

Transform Tags

<TRANSFORM>

This tag represents a non-skewing three-dimensional transform. Positions are scaled toward the origin in their original space by the specified scaling amount.

Required Tags
<FORWARD>

This tag must contain exactly 1 3D vector. The positive Z-axis of transformed points will point in the direction of this vector.

<UP>

This tag must contain exactly 1 3D vector. The positive Y-axis of transformed points will point as closely as possible to this vector. This vector must not be equal to or opposite of the forward vector.

<POSITION>

This tag must contain exactly 1 3D vector. Points are translated so that the origin in the original space is moved to specified position.

Optional Tags
<SCALE>

This tag represents a non-skewing three-dimensional transform. Points are scaled toward the origin of their original space by the specified scaling amount. If this tag is not included, a scaling factor of 1.0 is used. The scale must be greater than zero. There can be at most one scale tag within the transform.

Mesh Tags

<MESH>

The <MESH> tag represents a collection of related triangles, lines and points that approximate a 3D object.

Optional Tags
Faces

A mesh may contain any number of <F> tags.

Lines

A mesh may contain any number of <L> tags.

Points

A mesh may contain any number of <PT> tags.

Patches

A mesh may contain any number of <PATCH> tags.

<SURFACE>

If this tag is present, faces will be visible from both sides. If this flag is absent, faces will be visible from only one side as described in the <F> tag.

Available Defines
<MAT>
<LINESTYLE>
<POINTSTYLE>
<TEXTURE>
<TEXTURERGB>
<TEXTURERGBA>
<TC>
<P>
<N>

<MESHREF>

This tag must contain an integer that corresponds to the "ID" attribute of a mesh that is defined in the current scope.

Patch Tags

<PATCH>

The <PATCH> tag represents a group of related faces, lines and points that may have data associated with them. The patch tag may include a "PATCHID" attribute, which is used to identify that patch and should be a positive integer. The 0 PATCHID is reserved and will be used for any faces, lines or points that are not in a patch.

Optional Tags
Faces

A patch may contain any number of <F> tags.

Lines

A patch may contain any number of <L> tags.

Points

A patch may contain any number of <PT> tags.

Data

Any number of data tags can be included within the <PATCH> tag. This data is associated with the faces that include the patch.

Available Defines
<MAT>
<LINESTYLE>
<POINTSTYLE>
<TEXTURE>
<TEXTURERGB>
<TEXTURERGBA>
<TC>
<P>
<N>

Face Tags

<F>

The <F> tag represents a triangular face that is part of a 3D object. When looking at the front side of the face, <FV1>, <FV2> and <FV3> will be in counter-clockwise order.

Required Tags
<FV1>

A <F> tag must contain exactly one <FV1> tag. This tag should be as described in the "Face Vertex Tags" section.

<FV2>

A <F> tag must contain exactly one <FV2> tag. This tag should be as described in the "Face Vertex Tags" section.

<FV3>

A <F> tag must contain exactly one <FV3> tag. This tag should be as described in the "Face Vertex Tags" section.

Material

A <F> tag must contain exactly one tag from the "Material Tags" section.

Optional Tags
Texture

A <F> tag may contain up to 1 tag from the "Texture Tags" section. If a texture is used, a tag from the "Texture Coordinate Tags" section must be included in <FV1>, <FV2>, and <FV3>.

<S>

A <F> tag may contain any number of <S> tags. Each <S> tag must contain a single integer identifying a shade group to which the face belongs. Faces that belong to the same shade group will be blended together. Blending is accomplished by calculating normals for the face vertices. Note that the <S> tag will not replace the normals specified by the <N> tag if the <N> tag is included in the <FV1>, <FV2>, or <FV3> tags for the face. The algorithm used to calculate face vertex normals for shade groups is as follows.

Let f be a group faces that share a vertex v and belong to the same shade group.

Let n be the number of faces in the group f.

Let fvnx be the face vertex normal of fx at vertex v.

Let qx be the angle formed by v and the other two vertices of fx.

FVNx = Sum(0 ≤ i ≤ n) fvni ' qi

fvnx = FVNx |FVNx|

Face Vertex Tags

<FV1>, <FV2>, <FV3>

These tags each represent an instance of a vertex on a face.

Required Tags
Position

A Face Vertex must have exactly one tag from the "Position Tags" section.

Optional Tags
Normal

A Face Vertex may have up to one tag from the "Normal Tags" section.

Texture Coordinate

A Face Vertex may have up to one tag from the "Texture Coordinate Tags" Section.

Line Tags

<L>

The <L> tag represents a line that is part of a 3D object. The line begins at <LV1> and ends at <LV2>.

Required Tags
<LV1>

A <L> tag must contain exactly one <LV1> tag. This tag should be as described in the "Line Vertex Tags" section. If <LV1> specifies a normal, <LV2> must also specify a normal.

<LV2>

A <L> tag must contain exactly one <LV2> tag. This tag should be as described in the "Line Vertex Tags" section. If <LV2> specifies a normal, <LV1> must also specify a normal.

Material

A <L> tag must contain exactly one tag from the "Material Tags" section. If normals are omitted from <LV1> and <LV2>, the diffuse, specular, and shininess material properties are ignored.

Optional Tags
Texture

A <L> tag may contain up to one tag from the "Texture Tags" section. If a texture is used, a tag from the "Texture Coordinate Tags" section must be included in <LV1> and <LV2>.

Line Style

A <L> tag may contain up to one tag from the "Line Style Tags" section.

Line Vertex Tags

<LV1>, <LV2>

These tags are identical to <FV1> and <FV2>. Please refer to the "Face Vertex Tags" section for a full definition.

Line Style Tags

<LINESTYLE>

The <LINESTYLE> tag describes the style in which a particular line should be displayed.

Required Tags
<LINEWIDTH>

A line style must have exactly one <LINEWIDTH> tag. This tag must contain a floating-point number that indicates the width of the line. The default value is 1.0. This number must be greater than 0.0. This number corresponds to the width parameter of the glLineWidth OpenGL function. For more details on how the <LINEWIDTH> tag affects rasterization of the line, please refer to the glLineWidth function in the OpenGL specification.

Optional Tags
<LINEPATTERN>

A line style may have up to one <LINEPATTERN> tag. This tag must contain the 4 character hexadecimal representation of a single 16-bit integer. For example the number 255 is represented as 00FF. The default value is FFFF. This integer corresponds to the pattern parameter of the glLineStipple OpenGL function. For more details on how the <LINEPATTERN> tag affects rasterization of the line, please refer to the glLineStipple function in the OpenGL specification.

<LINEPATTERNFACTOR>

A line style may have up to one <LINEPATTERNFACTOR> tag. This tag must contain an integer in the range 1 to 256 inclusive. The default value is 1. This integer corresponds to the factor parameter of the glLineStipple OpenGL function. For more details on how the <LINEPATTERNFACTOR> tag affects rasterization of the line, please refer to the glLineStipple function in the OpenGL specification.

<LINESTYLEREF>

This tag must contain an integer that corresponds to the "ID" attribute of a line style that is defined in the current scope.

Point Tags

<PT>

The <PT> tag represents a point that is part of a 3D object. The point is located at <PV1>.

Required Tags
<PV1>

A <PT> tag must contain exactly one <PV1> tag. This tag should be as described in the "Point Vertex Tags" section.

Material

A <PT> tag must contain exactly one tag from the "Material Tags" section. If the normal is omitted from <PV1>, the diffuse, specular, and shininess material properties are ignored.

Optional Tags
Texture

A <PT> tag may contain up to one tag from the "Texture Tags" section. If a texture is used, a tag from the "Texture Coordinate Tags" section must be included in <PV1>.

Point Style

A <PT> tag may contain up to one tag from the "Point Style Tags" section.

Point Vertex Tags

<PV1>

This tag is identical to <FV1>. Please refer to the "Face Vertex Tags" section for a full definition.

Point Style Tags

<POINTSTYLE>

The <POINTSTYLE> tag describes the style with which a particular point should be displayed.

Required Tags
<POINTSIZE>

A point style must have exactly one <POINTSIZE> tag. This tag must contain a floating-point number that indicates the size of the point. The default value is 1.0. This number must be greater than 0.0. This number corresponds to the size parameter of the glPointSize OpenGL function. For more details on how the <POINTSIZE> tag affects rasterization of the point, please refer to the glPointSize function in the OpenGL specification.

<POINTSTYLEREF>

This tag must contain an integer that corresponds to the "ID" attribute of a point style that is defined in the current scope.

Position Tags

<P>

This tag represents a position in a 3D coordinate space. The tag should contain a 3D vector.

<PREF>

This tag must contain an integer that corresponds to the "ID" attribute of a position that is defined in the current scope.

Normal Tags

<N>

This tag represents a position in a 3D coordinate space. The tag should contain a 3D vector.

<NREF>

This tag must contain an integer that corresponds to the "ID" attribute of a position that is defined in the current scope.

Texture Coordinate Tags

<TC>

This tag represents a position on the 2D space of a texture. The tag should contain a 2D vector in the form u,v. The texture coordinate 0,0 corresponds to the upper left had corner of the texture. The coordinate 1,1 corresponds to the lower right hand corner. To represent a repeated or clamped texture, values for u and v greater than 1 or less than 0 may be used.

<TCREF>

This tag must contain an integer that corresponds to the "ID" attribute of a <TC> that is defined in the current scope.

Texture Tags

<TEXTURE>

This tag represents a texture.

Required Tags
Texture Image

The texture must have exactly one tag from "Texture Image Tags" section.

Texture Function

The texture must have exactly one tag from "Texture Function Tags" section.

Texture Wrap

The texture must have exactly one tag from the "Texture Wrap Tags" section

Optional Tags
<TEXTUREBORDERCOLOR>

The <TEXTURE> tag may contain up to 1 <TEXTUREBORDERCOLOR> tag. This tag must contain a 4D vector in the form R,G,B,A representing a color for a border of the texture. This tag should be used in conjunction with the <CLAMP> tag.

<TEXTUREREF>

This tag must contain an integer that corresponds to the "ID" attribute of a <TEXTURE> that is defined in the current scope.

Texture Image Tags

<TEXTURERGBA>

This tag must contain attributes named "WIDTH" and "HEIGHT". These attributes must be integers specifying the width and height of the texture RGBA data.

The data in this tag represents the color and alpha values for the pixels in a texture. All values must be represented in hexadecimal form in the rage of 00 - FF. Each pixel is represented as 8 characters in the following form:

RRGGBBAA

RR represents the red component of the pixel.

GG represents the green component of the pixel.

BB represents the blue component of the pixel.

AA represents the alpha component of the pixel.

For the red, green, and blue components, 00 represents no brightness, and FF represents full brightness. For the alpha component, 00 represents completely transparent, and FF represents completely opaque.

The data must contain width*height pixels without white space or separators of any kind.

<TEXTURERGB>

This tag must contain attributes named "WIDTH" and "HEIGHT". These attributes must be integers specifying the width and height of the texture RGB data.

The data in this tag represents the color values for the pixels in a texture that contains no alpha components. All values must be represented in hexadecimal form in the rage of 00 - FF. Each pixel is represented as 6 characters in the following form:

RRGGBB

RR represents the red component of the pixel.

GG represents the green component of the pixel.

BB represents the blue component of the pixel.

For the all components, 00 represents no brightness, and FF represents full brightness.

The data must contain width*height pixels without white space or separators of any kind.

<TEXTURERGBAREF>

This tag must contain an integer that corresponds to the "ID" attribute of a <TEXTURERGBA> tag that is defined in the current scope.

<TEXTURERGBREF>

This tag must contain an integer that corresponds to the "ID" attribute of a <TEXTURERGB> tag that is defined in the current scope.

Texture Function Tags

These tags specify how texture pixels are combined with primitive pixels. The following notation is used for this section:

C - Color value of the combined pixel

A - Alpha value of the combined pixel

Ct - Color value (R,G,B) of the pixel in the texture

Cf - Color value (R,G,B) of the pixel in the face

At - Alpha value of the pixel in the texture

Af - Alpha value of the pixel in the face

<REPLACE>

This tag specifies the replace texture function. Texture pixels will be combined with face pixels as follows:

C = Ct

A = At

<MODULATE>

This tag specifies the modulate texture function. Texture pixels will be combined with face pixels as follows:

C = CfCt

A = AfAt

<DECAL>

This tag specifies the decal texture function. Texture pixels will be combined with face pixels as follows:

C = Cf(1-At) + CtAt

A = Af

Texture Wrap Tags

<REPEAT>

This tag indicates that texture coordinate values outside the rage 0-1 cause the texture to repeat on the face.

<CLAMP>

This tag indicates that texture coordinate values outside the rage 0-1 are clamped to 0 or 1. This tag should be used in conjunction with the <TEXTUREBORDERCOLOR> tag.

Material Tags

<MAT>

The <MAT> element represents the way that a surface interacts with the light that hits it.

Required Tags
<AMB>

A material must have exactly one <AMB> tag. This tag must contain a vector whose components describe the fraction of ambient red, green, and blue light that the object reflects. Each component should be between 0.0 and 1.0 inclusive.

<DIFF>

A material must have exactly one <DIFF> tag. This tag must contain a vector whose components describe the fraction of diffuse red, green, and blue light that the object reflects. Each component should be between 0.0 and 1.0 inclusive.

Optional Tags
<SPEC>

A material may have up to one <SPEC> tag. This tag contains a vector whose components describe the fraction of specular red, green, and blue light that the object reflects. If this tag is not included, the material will reflect no specular light. Each component should be between 0.0 and 1.0 inclusive.

<EMISS>

A material may have up to one <EMISS> tag. This tag contains a vector whose components describe the amount of red, green, and blue light that the object emits. If this tag is not included, the material will emit no light. Each component should be between 0.0 and 1.0 inclusive.

<ALPHA>

A material may have up to one <ALPHA> tag. This tag contains a floating-point number that indicates how opaque the material is. The default value of 1.0 indicates that the material is completely opaque. This value can range from 1.0 to 0.0.

<SHINE>

A material may have up to one <SHINE> tag. This tag contains a floating-point number that indicates how a specular reflection from the material drops off. Value can range from 128.0, which indicates a tightly focused specular reflection down to 0.0. The default is 0.0.

<MATREF>

This tag must contain an integer that corresponds to the "ID" attribute of a material that is defined in the current scope.

Background Tags

<BACKGROUND>

The background tag represents the background on which 3D data should be displayed.

Required Tags
<BACKCOLOR>

A Background must have exactly one <BACKCOLOR> tag. This tag must contain a vector that represents the color that the object in the world should be displayed on. The three elements of the vector represent the red, green, and blue components of the background color. Each element must be in the range from 0.0 to 1.0 inclusive.

Lighting Tags

<LIGHTING>

The lighting tag describes the lighting in an environment.

Required Tags
Lighting Types Tags

The lighting tag must contain at least one tag from the "Lighting Types" section.

Lighting Types Tags

<AMBIENT>

The <AMBIENT> tag describes light that has equal intensity in all directions. It must include a vector whose elements represent the intensities of red, green, and blue light. These values must be between 0.0 and 1.0 inclusive. There can be at most one ambient tag within a lighting tag.

<DIRECTIONALLIGHT>

The directional light tag describes a light that comes from a particular direction, as if there was a light source an infinite distance away.

Required Tags
<DIRECTION>

A directional light must include exactly one <DIRECTION> tag. This tag must contain a 3D vector that describes the direction that light is shining from.

<DIFFUSE>

The <DIFFUSE> tag represents the components of lighting that are reflected diffusely by materials. This tag must include a vector whose elements represent the intensities of red, green, and blue light. These values must be between 0.0 and 1.0 inclusive.

<SPECULAR>

The <SPECULAR> tag represents the components of lighting that are reflected spectrally by materials. This tag must include a vector whose elements represent the intensities of red, green, and blue light. These values must be between 0.0 and 1.0 inclusive.

Data Tags

These tags represent application specific data that is associated with 3D data.

<DATA>

The <DATA> tag represents data structures defined by one particular organization. The tag must include an attribute "ORG" which is the name of the organization that defines the meaning of the data within this tag.

Required Tags
Data Element Tags

The <DATA> tag must include at least one tag from the Data Element Tags section.

Data Element Tags

These tags represent individual data elements that are associated with 3D data.

<STR>

The <STR> tag represents string data that is associated with an object. The "NAME" attribute must be set to a value that identifies the type of data that is included in this string. This tag should enclose the string data. Any leading or trailing white space is ignored.

<BIN>

The <BIN> tag represents binary data that is associated with an object. The "NAME" attribute must be set to a value that identifies the type of data that is included in this tag. This tag should enclose a hexadecimal representation of the data with no internal white space. Any leading or trailing white space is ignored.


 

Example

This example XGL file contains two green boxes in different positions in the world. Extensive referencing of defined items has been used to both reduce the size of the file and to make a clearer representation of the mesh.

<WORLD>

 

<BACKGROUND>

<BACKCOLOR>1.0,1.0,1.0</BACKCOLOR>

</BACKGROUND>

 

<LIGHTING>

<DIRECTIONALLIGHT>

<DIFFUSE>1.000,1.000,1.000</DIFFUSE>

<SPECULAR>0.100,0.100,0.100</SPECULAR>

<DIRECTION>0.302,-0.302,-0.905</DIRECTION>

</DIRECTIONALLIGHT>

<AMBIENT>0.000,0.000,0.000</AMBIENT>

</LIGHTING>

 

 

<MESH ID="0">

 

<MAT ID="0">

<AMB>0.000,1.000,0.000</AMB>

<DIFF>0.000,1.000,0.000</DIFF>

<SPEC>1.000,1.000,1.000</SPEC>

<EMISS>0.000,0.000,0.000</EMISS>

<SHINE>64.0</SHINE>

<ALPHA>1.000</ALPHA>

</MAT>

 

<P ID="0">-1.0,-0.5,0.0</P>

<P ID="1">-1.0,-0.5,1.0</P>

<P ID="2">-1.0,0.5,0.0</P>

<P ID="3">-1.0,0.5,1.0</P>

<P ID="4">0.0,-0.5,0.0</P>

<P ID="5">0.0,-0.5,1.0</P>

<P ID="6">0.0,0.5,0.0</P>

<P ID="7">0.0,0.5,1.0</P>

 

<N ID="0">-1.0,0.0,0.0</N>

<N ID="1">0.0,-1.0,0.0</N>

<N ID="2">1.0,0.0,0.0</N>

<N ID="3">0.0,1.0,0.0</N>

<N ID="4">0.0,0.0,1.0</N>

<N ID="5">0.0,0.0,-1.0</N>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>0</PREF><NREF>0</NREF></FV1>

<FV2><PREF>1</PREF><NREF>0</NREF></FV2>

<FV3><PREF>2</PREF><NREF>0</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>2</PREF><NREF>0</NREF></FV1>

<FV2><PREF>1</PREF><NREF>0</NREF></FV2>

<FV3><PREF>3</PREF><NREF>0</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>4</PREF><NREF>1</NREF></FV1>

<FV2><PREF>5</PREF><NREF>1</NREF></FV2>

<FV3><PREF>0</PREF><NREF>1</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>0</PREF><NREF>1</NREF></FV1>

<FV2><PREF>5</PREF><NREF>1</NREF></FV2>

<FV3><PREF>1</PREF><NREF>1</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>6</PREF><NREF>2</NREF></FV1>

<FV2><PREF>7</PREF><NREF>2</NREF></FV2>

<FV3><PREF>4</PREF><NREF>2</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>4</PREF><NREF>2</NREF></FV1>

<FV2><PREF>7</PREF><NREF>2</NREF></FV2>

<FV3><PREF>5</PREF><NREF>2</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>2</PREF><NREF>3</NREF></FV1>

<FV2><PREF>3</PREF><NREF>3</NREF></FV2>

<FV3><PREF>6</PREF><NREF>3</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>6</PREF><NREF>3</NREF></FV1>

<FV2><PREF>3</PREF><NREF>3</NREF></FV2>

<FV3><PREF>7</PREF><NREF>3</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>5</PREF><NREF>4</NREF></FV1>

<FV2><PREF>7</PREF><NREF>4</NREF></FV2>

<FV3><PREF>1</PREF><NREF>4</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>1</PREF><NREF>4</NREF></FV1>

<FV2><PREF>7</PREF><NREF>4</NREF></FV2>

<FV3><PREF>3</PREF><NREF>4</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>2</PREF><NREF>5</NREF></FV1>

<FV2><PREF>6</PREF><NREF>5</NREF></FV2>

<FV3><PREF>0</PREF><NREF>5</NREF></FV3>

</F>

 

<F>

<MATREF>0</MATREF>

<FV1><PREF>0</PREF><NREF>5</NREF></FV1>

<FV2><PREF>6</PREF><NREF>5</NREF></FV2>

<FV3><PREF>4</PREF><NREF>5</NREF></FV3>

</F>

 

</MESH>

 

 

<OBJECT>

<TRANSFORM>

<FORWARD>0.000000,0.000000,1.000000</FORWARD>

<UP>0.000000,1.000000,0.000000</UP>

<POSITION>0.000000,0.900000,-0.000000</POSITION>

<SCALE>1.000000</SCALE>

</TRANSFORM>

<MESHREF>0</MESHREF>

</OBJECT>

 

<OBJECT>

<TRANSFORM>

<FORWARD>0.000000,0.000000,1.000000</FORWARD>

<UP>0.000000,1.000000,0.000000</UP>

<POSITION>-0.900000,-0.000000,0.000000</POSITION>

<SCALE>1.000000</SCALE>

</TRANSFORM>

<MESHREF>0</MESHREF>

</OBJECT>

 

</WORLD>


 

Changes

9/8/01

Lines and Points are now available in the specification. Displayable names have been added for the world tag and all object tags.

4/20/01

The <INCLUDESTATIC> tag has been added for statically including XGL files.

11/07/00

A <MESH> tag is now allowed in the world context. Object tags are not required anymore.

3/23/00

The <INCLUDE> tag has been added as a way to include other XGL files. The <REF>, <REFTYPE>, and <EXTENTS> tags have been added as well. The standard Ref Type FILE has been defined.

12/25/99

The <OBJECT> tag may not contain both a mesh and (sub) object tags.

A <MESH> tag need not include any <F> tags.

A <PATCH> tag need not include any <F> tags.

The <SCALE> tag's value must be positive.

A <PATCH> is identified by a PATCHID not an ID. The 0 PATCHID is reserved.

11/16/99

The <PATCH> tag must contain at least one <F> tag and may not contain another <PATCH> tag.

A <MESH> tag must contain at least one tag from the "Face Tags" section.

The following tags have been added to support textures:

<TC>

<TCREF>

<TEXTURE>

<TEXTUREBORDERCOLOR>

<TEXTUREREF>

< TEXTURERGBA>

< TEXTURERGB>

< TEXTURERGBAREF>

< TEXTURERGBREF>

<REPLACE>

<MODULATE>

<DECAL>

<REPEAT>

<CLAMP>

A <F> tag may include up to 1 texture tag.

The <OBJECTREF> tag has been added to allow the referencing of defined <OBJECT> tags.

2D and 4D vectors are described in the "Vectors" section.

<TEXTURE>, <TEXTURERGB>, <TEXTURERGBA>, and <TC> tags may be defined in <WORLD>, <OBJECT>, <MESH>, and <PATCH> tags.

<MAT>, <P>, and <N> tags may be defined in the <PATCH> tag.

<OBJECT> tags may be defined in <WORLD> and <OBJECT> tags.

The <S> tag was added to support shade groups. The <S> tag may be included in the <F> tag.

10/13/99

The default value for the <SHINE> tag if it is not specified is 0.0. This matches the OpenGL default. This change doesn't require modifications to XGL files.

10/12/99

The <SHINE> tag in a material should be in the range from 0.0 to 128.0, to be more like OpenGL.

The <DIRECTION> tag in a directional light should indicate that the light comes from rather than the direction that the light shines in. Again, this is more like OpenGL.

10/11/99

The "CHILDID" attribute of the <OBJECT> tag has been renamed to "PATHID". This was done to cut down on confusion between this ID and the upcoming ID that allows referencing of object.

The <SURFACE> tag has been added to the <MESH> tag. This tag allows surfaces that are visible from both sides.