View Single Post
  #1  
Old 07-03-2004, 07:08 AM
Windcatcher
Demi-God
 
Join Date: Jan 2002
Posts: 1,175
Default OpenZone .SCN and .MSH information

Apparently some of you are interested in working with the OpenZone .MSH files I made and you need some help with the file format. Most of it is self-explanatory, but the TRIANGLE, TRIANGLETEX, RECTANGLE, and RECTANGLETEX statements could use some explanation. Here I'll outline what they mean so people can read them (of course you could also look at OpenZone's souce code -- namely TMeshObject.LoadFromFile() in ZoneClasses.pas).

TRIANGLE

X1, Y1, Z1 - first point location

X2, Y2, Z2 - second point location

X3, Y3, Z3 - third point location

Textures - semicolon-delimited list of textures (no file path or extension)

Transparent - True if the object is totally transparent

Semitransparent - True if the object is semitransparent

Solid - False if the player can pass through it (like a cobweb, for instance)

Color - 32-bit RGBA number specifying a hue to apply to the object

HasColor - If true, then Color is applied, otherwise Color is ignored.

Tag - Used for ground meshes. Signifies that polygon's position on the ground grid.

HasTag - If false, then Tag is ignored.

Angle - Used for ground meshes. Should only contain 0, 90, 180, or 270, and specifies the texture orientation on the ground grid.

HasAngle - If false, then Angle is ignored (default angle is 0).

Masked - If true, then the object uses a masked texture (like the leaves on a tree). Masked textures have areas that are transparent.

HasMasked - If false, then Masked is ignored.

HasNormal - if false then the following Normal fields are ignored:

NX1,NY1,NZ1,NX2,NY2,NZ2,NX3,NY3,NZ3 - The components of the polygon's normal vector. Note that a normal vector is always 1 unit long.


TRIANGLETEX is similar to TRIANGLE, except that it also contains texture coordinates for each vertex:

TX1,TZ1,TX2,TZ2,TX3,TZ3 - Texture coordinates for each vertex. They come immediately after the vertex values (X1...Z3).

RECTANGLE and RECTANGLETEX are similar to the triangle variants but there are four vertex and texture coordinates instead of three.

I realize that this file format is a hack. I really should just trash it and go to an XML-based format and include something to convert to it. Anyway, hopefully this will help those of you who are trying to read .MSH files. If you have more questions, feel free to drop me a line.

WC
Reply With Quote