Jump to content

XML:M3GM: Difference between revisions

m
copy-edit
m (Undo revision 25564 by Paradox-01 (talk))
m (copy-edit)
Line 1: Line 1:
{{XML_File_Header | type=M3GM | prev=M3GA | next=Mtrl | name=Geometry }}
{{XML_File_Header | type=M3GM | prev=M3GA | next=Mtrl | name=Geometry}}
 


==General information==
==General information==
* The xml code on this page was tested with onisplit v0.9.86.0, v0.9.94.0 and v0.9.95.0
* The XML on this page was tested with OniSplit v0.9.86.0, v0.9.94.0 and v0.9.95.0.
* M3GM files local (level''N'') and global (level0).
* M3GM files can be both local (level''N'') and global (level0).
** Most global M3GMs are used by particle.
** Most global M3GMs are used by particles.
** Most local M3GMs are doors or animated objects.
** Most local M3GMs are the models used for doors or animated objects.


 
==File structure==
==M3GM==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=200px| XML tag
!width=200px| XML tag
!width=100px| content type
!width=100px| Content type
! description
! Description
|-
|-
| <M3GM id="...">
| <M3GM id="...">
Line 21: Line 19:
|valign=top| <Points>
|valign=top| <Points>
|valign=top| link
|valign=top| link
| "#" + instance Id of [[#PNTA|PNTA]].
| "#" + instance ID of [[#PNTA|PNTA]].
: XYZ and UV coordinates are stored in parallel (same number of entries in PNTA and TXCA).  
: XYZ and UV coordinates are stored in parallel (same number of entries in PNTA and TXCA).  
|-
|-
|valign=top| <VertexNormals>
|valign=top| <VertexNormals>
|valign=top| link
|valign=top| link
| "#" + instance Id of [[#VCRA|VCRA]].
| "#" + instance ID of [[#VCRA|VCRA]].
: The first VCRA stores the normals for every vertex (same entries as in PNTA and TXCA).
: The first VCRA stores the normals for every vertex (same entries as in PNTA and TXCA).
: Vertex normals are used by Gouraud shading (directional lighting).
: Vertex normals are used by Gouraud shading (directional lighting).
Line 32: Line 30:
|valign=top| <FaceNormals>
|valign=top| <FaceNormals>
|valign=top| link
|valign=top| link
| "#" + instance Id of [[#VCRA|VCRA]].
| "#" + instance ID of [[#VCRA|VCRA]].
: The second VCRA stores the normals for every face (groups defined by the second IDXA).
: The second VCRA stores the normals for every face (groups are defined by the second IDXA).
: Face normals are used for backface culling.
: Face normals are used for backface culling.
|-
|-
|valign=top| <TextureCoordinates>
|valign=top| <TextureCoordinates>
|valign=top| link
|valign=top| link
| "#" + instance Id of [[#TXCA|TXCA]].
| "#" + instance ID of [[#TXCA|TXCA]].
: Vertex UVs.
: Vertex UVs.
|-
|-
|valign=top| <TriangleStrips>
|valign=top| <TriangleStrips>
|valign=top| link
|valign=top| link
| "#" + instance Id of [[#IDXA|IDXA]].
| "#" + instance ID of [[#IDXA|IDXA]].
: The first IDXA lists the triangles as strips. The IDs are the ones in PNTA and IDXA.
: The first IDXA lists the triangles as strips. The IDs are the ones in PNTA and IDXA.
: The start of a new strip is signaled by a high bit in the ID of its first vertex.
: The start of a new strip is signaled by a high bit in the ID of its first vertex.
: Strips are more optimal for rendering, they are generated when authoring an M3GM.
: Strips are more optimal for rendering; they are generated when authoring an M3GM.
|-
|-
|valign=top| <FaceNormalIndices>
|valign=top| <FaceNormalIndices>
|valign=top| link
|valign=top| link
| "#" + instance Id of [[#IDXA|IDXA]].
| "#" + instance ID of [[#IDXA|IDXA]].
: The second IDXA groups the triangles into faces (oriented by the second VCRA).
: The second IDXA groups the triangles into faces (oriented by the second VCRA).
|-
|-
Line 57: Line 55:
| TXMP''name''
| TXMP''name''
|}
|}


===PNTA===
===PNTA===
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=200px| XML tag
!width=200px| XML tag
!width=100px| content type
!width=100px| Content type
! description
! Description
|-
|-
| <PNTA id="...">
| <PNTA id="...">
| integer
| integer
| Instance Id.
| Instance ID.
|-
|-
| <BoundingBox>
| <BoundingBox>
Line 101: Line 98:
| X Y Z coordinate of the point.
| X Y Z coordinate of the point.
|}
|}


===VCRA===
===VCRA===
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=200px| XML tag
!width=200px| XML tag
!width=100px| content type
!width=100px| Content type
! description
! Description
|-
|-
| <VCRA id="...">
| <VCRA id="...">
| integer
| integer
| Instance Id.  
| Instance ID.  
|-
|-
| <Normals>
| <Normals>
Line 121: Line 117:
| X Y Z coordinate of the normal vector.
| X Y Z coordinate of the normal vector.
|}
|}


===TXCA===
===TXCA===
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=200px| XML tag
!width=200px| XML tag
!width=100px| content type
!width=100px| Content type
! description
! Description
|-
|-
| <TXCA id="...">
| <TXCA id="...">
| integer
| integer
| Instance Id.
| Instance ID.
|-
|-
| <TexCoords>
| <TexCoords>
Line 141: Line 136:
| X Y coordinates.
| X Y coordinates.
|}
|}


===IDXA===
===IDXA===
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=200px| XML tag
!width=200px| XML tag
!width=100px| content type
!width=100px| Content type
! description
! Description
|-
|-
| <IDXA id="...">
| <IDXA id="...">
| integer
| integer
| Instance Id.
| Instance ID.
|-
|-
| <Indices>
| <Indices>
Line 165: Line 159:
: VCRA element ID (used to assign the normals to every triangle)
: VCRA element ID (used to assign the normals to every triangle)
|}
|}


==Export==
==Export==
===oni to obj/dae===
===.oni to OBJ/DAE===
  onisplit -extract:obj ''output_folder input_folder''/M3GM''file_name''.oni
  onisplit -extract:obj ''output_folder input_folder''/M3GM''file_name''.oni
  onisplit -extract:dae ''output_folder input_folder''/M3GM''file_name''.oni
  onisplit -extract:dae ''output_folder input_folder''/M3GM''file_name''.oni


Or use [[Vago_(tool)|Vago]].
Or you can simply use [[Vago_(tool)|Vago]].


===dat to oni===
===.dat to .oni===
  onisplit -export:''object_name'' ''output_folder input_folder''/''file_name''.dat
  onisplit -export:''object_name'' ''output_folder input_folder''/''file_name''.dat
File prefix M3GM in object_name is optional.
The file prefix "M3GM" in ''object_name'' is optional.
 
The command's integration into Vago has been requested.


This command's integration into Vago has been requested.


==Import==
==Import==
  onisplit -create:m3gm ''output_folder'' -tex:''TXMPfile_name'' ''input_folder''/''file_name''.obj
  onisplit -create:m3gm ''output_folder'' -tex:''TXMPfile_name'' ''input_folder''/''file_name''.obj


-tex argument is optional but should be always used if there's no MTL file alongside OBJ. If there's a MTL file, OniSplit will register its texture name in M3GM as TXMP link.
The "-tex" argument is optional, but should be always used if there's no MTL file alongside the OBJ. If there is an MTL file, OniSplit will register its texture name in M3GM as a TXMP link.
 
Or use [[Vago_(tool)|Vago]].


This command was broken in OniSplit v0.9.86.0 and v0.9.94.0.
Or you can simply use [[Vago_(tool)|Vago]].


Note: This command was broken in OniSplit v0.9.86.0 and v0.9.94.0.


{{XML}}
{{XML}}