📄 m2.mht
字号:
<TD>0x0A </TD>
<TD>uint16 </TD>
<TD> ? </TD></TR>
<TR>
<TD>0x0C </TD>
<TD>AnimationBlock (float, float, float) </TD>
<TD>Animation data for translation </TD></TR>
<TR>
<TD>0x28 </TD>
<TD>AnimationBlock (float, float, float, float) </TD>
<TD>Animation data for rotation </TD></TR>
<TR>
<TD>0x44 </TD>
<TD>AnimationBlock (float, float, float) </TD>
<TD>Animation data for scaling </TD></TR>
<TR>
<TD>0x60 </TD>
<TD>float[3] </TD>
<TD>Pivot point </TD></TR></TBODY></TABLE>
<P>Keyframe data: float[3] vectors for translation and scaling, float[4] =
quaternions for rotation. </P>
<P>Flags: </P>
<TABLE class=3Dfileformat>
<TBODY>
<TR>
<TH>Value </TH>
<TH>Description </TH></TR>
<TR>
<TD>8 </TD>
<TD>billboarded </TD></TR>
<TR>
<TD>512 </TD>
<TD>transformed </TD></TR></TBODY></TABLE>
<P>The billboarding bit is used for various things: </P>
<UL>
<LI>Light halos around lamps must always face the viewer=20
<LI>The cannonball stack model (in the Deadmines or Booty Bay), where =
each=20
cannonball is a crude hemisphere, they always face the viewer to =
create the=20
illusion of actual cannonballs (one wonders why Blizzard bothered with =
this,=20
is a small sphere so hard to model? -_-) </LI></UL>
<P><BR></P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D9">edit</A>]</DIV><A=20
name=3DGeometry_and_rendering></A>
<H1>Geometry and rendering </H1>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D10">edit</A>]</DIV><A=20
name=3DVertices></A>
<H2>Vertices </H2>
<P>48 bytes per vertex </P>
<P>Models, too, use a Z-up coordinate systems, so in order to convert to =
Y-up,=20
the X, Y, Z values become (X, -Z, Y). </P>
<P><BR></P>
<TABLE class=3Dfileformat>
<TBODY>
<TR>
<TH>Offset </TH>
<TH>Type </TH>
<TH>Description </TH></TR>
<TR>
<TD>0x00 </TD>
<TD>float[3] </TD>
<TD>Position </TD></TR>
<TR>
<TD>0x0C </TD>
<TD>uint8[4] </TD>
<TD>Bone weights (0 to 255) </TD></TR>
<TR>
<TD>0x10 </TD>
<TD>uint8[4] </TD>
<TD>Bone indices (0 to <I>nBones</I>-1) </TD></TR>
<TR>
<TD>0x14 </TD>
<TD>float[3] </TD>
<TD>Normal vector </TD></TR>
<TR>
<TD>0x20 </TD>
<TD>float[2] </TD>
<TD>Texture coordinates </TD></TR>
<TR>
<TD>0x28 </TD>
<TD>float[2] </TD>
<TD>0? </TD></TR></TBODY></TABLE>
<P><BR>The fields marked with ? probably have to do with skeletal=20
animation. </P>
<P>++++ Guest: Considering "standard" GPU sceletal animation (matrix =
palette, 4=20
weights/bones per vertex): </P>
<P>then "usually 255" should be an array of 4 unsigned chars defning the =
vertex=20
weight for 4 bones </P>
<P>tehn "vertex group" should be an Array of 4 unsigned chars indexing 4 =
bones=20
++++ </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D11">edit</A>]</DIV><A=20
name=3DViews_.28LOD.29></A>
<H2>Views (LOD) </H2>
<P>Every model has four of these, at 0x2C bytes each. I'm not sure if it =
is LOD=20
because each one of them has the same amount of vertices for all four =
data sets.=20
(???) First I thought this might be different vertex orderings from =
different=20
views, to ease polygon sorting for transparent faces, but that's not it =
either.=20
Hmm. </P>
<P>Starting at <I>ofsViews</I>, there are four View (LOD?) header =
records=20
followed by the data for all four. </P>
<P><BR></P>
<TABLE class=3Dfileformat>
<TBODY>
<TR>
<TH>Offset </TH>
<TH>Type </TH>
<TH>Description </TH></TR>
<TR>
<TD>0x00 </TD>
<TD>uint32 </TD>
<TD>number of elements in the index list </TD></TR>
<TR>
<TD>0x04 </TD>
<TD>uint32 </TD>
<TD>offset to the index list </TD></TR>
<TR>
<TD>0x08 </TD>
<TD>uint32 </TD>
<TD>number of elements in the triangle list (this is 3* the number =
of=20
triangles to be drawn) </TD></TR>
<TR>
<TD>0x0C </TD>
<TD>uint32 </TD>
<TD>offset to the triangle list </TD></TR>
<TR>
<TD>0x10 </TD>
<TD>uint32 </TD>
<TD>number of elements in the vertex property list </TD></TR>
<TR>
<TD>0x14 </TD>
<TD>uint32 </TD>
<TD>offset to the vertex property list </TD></TR>
<TR>
<TD>0x18 </TD>
<TD>uint32 </TD>
<TD>number of elements in the submesh list </TD></TR>
<TR>
<TD>0x1C </TD>
<TD>uint32 </TD>
<TD>offset to the submesh list </TD></TR>
<TR>
<TD>0x20 </TD>
<TD>uint32 </TD>
<TD>number of elements in the texture list </TD></TR>
<TR>
<TD>0x24 </TD>
<TD>uint32 </TD>
<TD>offset to the texture list </TD></TR>
<TR>
<TD>0x28 </TD>
<TD>uint32 </TD>
<TD>LOD distance or something? </TD></TR></TBODY></TABLE>
<P><BR></P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D12">edit</A>]</DIV><A=20
name=3DIndices></A>
<H3>Indices </H3>
<P>A 16-bit unsigned integer per index, specifies vertices from the =
global=20
vertex list. </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D13">edit</A>]</DIV><A=20
name=3DTriangles></A>
<H3>Triangles </H3>
<P>For every triangle, three 16-bit unsigned ints. These refer to the =
index list=20
given above, not the global vertex list. </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D14">edit</A>]</DIV><A=20
name=3DVertex_properties></A>
<H3>Vertex properties </H3>
<P>4 bytes per vertex. Usually 0? Purpose unknown. </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D15">edit</A>]</DIV><A=20
name=3DSubmeshes></A>
<H3>Submeshes </H3>
<P>32 bytes per submesh. </P>
<P><BR></P>
<TABLE class=3Dfileformat>
<TBODY>
<TR>
<TH>Offset </TH>
<TH>Type </TH>
<TH>Description </TH></TR>
<TR>
<TD>0x00 </TD>
<TD>uint32 </TD>
<TD>Mesh part ID </TD></TR>
<TR>
<TD>0x04 </TD>
<TD>uint16 </TD>
<TD>Starting vertex number </TD></TR>
<TR>
<TD>0x06 </TD>
<TD>uint16 </TD>
<TD>Number of vertices </TD></TR>
<TR>
<TD>0x08 </TD>
<TD>uint16 </TD>
<TD>Starting triangle index (that's 3* the number of triangles drawn =
so=20
far) </TD></TR>
<TR>
<TD>0x0A </TD>
<TD>uint16 </TD>
<TD>Number of triangle indices </TD></TR>
<TR>
<TD>0x0C </TD>
<TD>uint16 </TD>
<TD>Number of elements in Block Y </TD></TR>
<TR>
<TD>0x0E </TD>
<TD>uint16 </TD>
<TD>Starting index in Block Y </TD></TR>
<TR>
<TD>0x10 </TD>
<TD>uint16 </TD>
<TD>Unknown </TD></TR>
<TR>
<TD>0x12 </TD>
<TD>uint16 </TD>
<TD>Unknown </TD></TR>
<TR>
<TD>0x14 </TD>
<TD>float[3] </TD>
<TD>3 float values? </TD></TR></TBODY></TABLE>
<P><BR>Mesh part ID: for character models, each hairstyle/thick =
armor/etc is=20
present in the mesh, so to render a character with a specific set of =
looks, some=20
of the submeshes should be ommitted based on this ID. </P>
<P>Reference to Block Y: the base number seems to increase per LOD, and =
the=20
numbers in Block Y, in turn, point to bones (?) - indices to Block E. =
Maybe this=20
could be an indicator of bones used in a submesh, or an animation =
sequence or=20
something? </P>
<P>About LOD: Creatures\AncientProtector\AncientProtector.m2 is the =
first model=20
I found where the LOD levels have a significant difference. The 4th LOD =
level=20
still has the same number of vertices/polygons, but it has more =
submeshes (more=20
sophisticated animation/lighting or something? I dunno) </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D16">edit</A>]</DIV><A=20
name=3DTexture_units></A>
<H3>Texture units </H3>
<P>More specifically, textures for each texture unit. Based on the =
current=20
submesh number, one or two of these are used to determine the texture(s) =
to=20
bind. </P>
<P>24 bytes per record. </P>
<P><BR></P>
<TABLE class=3Dfileformat>
<TBODY>
<TR>
<TH>Offset </TH>
<TH>Type </TH>
<TH>Description </TH></TR>
<TR>
<TD>0x00 </TD>
<TD>uint16 </TD>
<TD>Flags </TD></TR>
<TR>
<TD>0x02 </TD>
<TD>int16 </TD>
<TD>Render order (used in skyboxes to ditch the need for depth =
buffering)=20
</TD></TR>
<TR>
<TD>0x04 </TD>
<TD>uint16 </TD>
<TD>Submesh index </TD></TR>
<TR>
<TD>0x06 </TD>
<TD>uint16 </TD>
<TD>Submesh index (repeated?) </TD></TR>
<TR>
<TD>0x08 </TD>
<TD>int16 </TD>
<TD>Color index or -1 </TD></TR>
<TR>
<TD>0x0A </TD>
<TD>uint16 </TD>
<TD>Index into render flags table </TD></TR>
<TR>
<TD>0x0C </TD>
<TD>uint16 </TD>
<TD>Texture unit number (0 or 1 - index into the texture unit lookup =
table) </TD></TR>
<TR>
<TD>0x0E </TD>
<TD>uint16 </TD>
<TD>always 1? </TD></TR>
<TR>
<TD>0x10 </TD>
<TD>uint16 </TD>
<TD>Texture to use (index into the texture lookup table) </TD></TR>
<TR>
<TD>0x12 </TD>
<TD>uint16 </TD>
<TD>Texture unit number (repeated?) </TD></TR>
<TR>
<TD>0x14 </TD>
<TD>uint16 </TD>
<TD>Transparency (index into transparency lookup table) </TD></TR>
<TR>
<TD>0x16 </TD>
<TD>uint16 </TD>
<TD>Texture animation (index into the texture animation lookup =
table)=20
</TD></TR></TBODY></TABLE>
<P><BR>Flags: usually 16 for static textures, and 0 for animated =
textures. </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D17">edit</A>]</DIV><A=20
name=3DRender_flags></A>
<H2>Render flags </H2>
<P><I>nRenderFlags</I> (uint16, uint16) pairs starting at =
<I>ofsRenderFlags</I>=20
</P>
<P>The first value contains flags. </P>
<TABLE class=3Dfileformat>
<TBODY>
<TR>
<TH>Flag </TH>
<TH>Meaning </TH></TR>
<TR>
<TD>0x01 </TD>
<TD>Unlit </TD></TR>
<TR>
<TD>0x02 </TD>
<TD>Unfogged? </TD></TR>
<TR>
<TD>0x04 </TD>
<TD>Two-sided (no backface culling if set) </TD></TR>
<TR>
<TD>0x08 </TD>
<TD> ? </TD></TR>
<TR>
<TD>0x10 </TD>
<TD>Disable z-buffer? </TD></TR></TBODY></TABLE>
<P><BR>The second value specifies the blending mode </P>
<TABLE class=3Dfileformat>
<TBODY>
<TR>
<TH>Value </TH>
<TH>Meaning </TH></TR>
<TR>
<TD>0 </TD>
<TD>Opaque </TD></TR>
<TR>
<TD>1 </TD>
<TD>Alpha testing only </TD></TR>
<TR>
<TD>2 </TD>
<TD>Alpha blending </TD></TR>
<TR>
<TD>3 </TD>
<TD>Additive? </TD></TR>
<TR>
<TD>4 </TD>
<TD>Additive alpha? </TD></TR>
<TR>
<TD>5 </TD>
<TD>Modulate? </TD></TR>
<TR>
<TD>6 </TD>
<TD>Used in the Deeprun Tram subway glass, supposedly =
(src=3Ddest_color,=20
dest=3Dsrc_color) (?) </TD></TR></TBODY></TABLE>
<P><BR>Most of these blend values are taken from the MDL docs, but they =
sort of=20
work (like additive blending for light shafts and such) </P>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A =
title=3DM2=20
href=3D"http://wowmapview.sourceforge.net/wiki/index.php?title=3DM2&a=
ction=3Dedit&section=3D18">edit</A>]</DIV><A=20
name=3DTexture_unit_lookup_table></A>
<H2>Texture unit lookup table </H2>
<P><I>nTexUnits</I> 16-bit integers starting at <I>ofsTexUnits</I>. =
(values: -1,=20
0, 1) </P>
<P>For models that use multitexturing, this maps given texture unit =
numbers into=20
actual texture unit numbers (0 or 1). </P>
<P>Values of -1 seem to mean environment mapping. </P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -