Changes between Version 12 and Version 13 of ArtDesignDocument


Ignore:
Timestamp:
Jul 16, 2009, 1:27:41 AM (15 years ago)
Author:
Jason
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ArtDesignDocument

    v12 v13  
    585585
    586586= Folder Structure =
    587 DATA[[BR]] +MODS[[BR]] +OFFICIAL[[BR]] +ART[[BR]] ¦ACTORS[[BR]] ¦ ¦FAUNA[[BR]] ¦ ¦FLORA[[BR]] ¦ ¦GEOLOGY[[BR]] ¦ ¦PROPS[[BR]] ¦ ¦ ¦FAUNA[[BR]] ¦ ¦ ¦FLORA[[BR]] ¦ ¦ ¦GEOLOGY[[BR]] ¦ ¦ ¦STRUCTURES[[BR]] ¦ ¦ ¦TEMP[[BR]] ¦ ¦ +UNITS[[BR]] ¦ ¦STRUCTURES[[BR]] ¦ ¦TEMP[[BR]] ¦ +UNITS[[BR]] ¦ANIMATION[[BR]] ¦ ¦BIPED[[BR]] ¦ ¦GAIA[[BR]] ¦ ¦MECHANICAL[[BR]] ¦ ¦QUADRAPED[[BR]] ¦ +SIMPLE[[BR]] ¦MATERIALS[[BR]] ¦MESHES[[BR]] ¦ ¦GAIA[[BR]] ¦ ¦PROPS[[BR]] ¦ ¦SKELETAL[[BR]] ¦ ¦STRUCTURAL[[BR]] ¦ ¦TEMP[[BR]] ¦ +TEST[[BR]] ¦SKELETONS[[BR]] +TEXTURES[[BR]] ¦ANIMATED[[BR]] ¦CURSORS[[BR]] ¦PARTICLES[[BR]] ¦SKIES[[BR]] ¦SKINS[[BR]] ¦ ¦GAIA[[BR]] ¦ ¦PROPS[[BR]] ¦ ¦SKELETAL[[BR]] ¦ ¦STRUCTURAL[[BR]] ¦ ¦TEMP[[BR]] ¦ +TEST[[BR]] ¦TERRAIN[[BR]] ¦ ¦ALPHAMAPS[[BR]] ¦ +TYPES[[BR]] +UI
    588 
    589 = Appendix A =
    590 == PMD File Format ==
    591 PMD files store a model, which includes vertex positions, normals and texture coordinates, faces (all faces are triangles), rest state bone transformations (if bones are used), and prop point positions and transformations (where other models may be propped onto this one).
    592 
    593 All types are stored in little-endian format. Text is always ASCII. The following is the version 2 PMD format:
    594 
    595 {{{
    596 PMD {
    597  char magic[4]; // == "PSMD"
    598  u32 version; // == 3
    599  u32 data_size; // == filesize-12
    600 
    601  u32 numVertices;
    602  Vertex vertices[numVertices];
    603 
    604  u32 numFaces;
    605  Face faces[numFaces];
    606 
    607  u32 numBones;
    608  BoneState restStates[numBones];
    609 
    610  u32 numPropPoints;
    611  PropPoint propPoints[numPropPoints]; // note: PropPoint has variable size (see below)
    612 }
    613 
    614 Vertex {
    615  Vector3D position; // in world space, matching the restStates pose
    616  Vector3D normal;
    617  float u, v;
    618  VertexBlend blend;
    619 }
    620 
    621 VertexBlend { // represents the set of bones affecting a vertex
    622  u8 bones[4]; // bone indices; 0xFF in any position indicates "no bone" for vertices with fewer than 4 bones
    623  float weights[4]; // add up to 1.0 (0 is used for unused bones)
    624 }
    625 
    626 Face {
    627  u16 vertices[3]; // vertex indices; all faces are triangles
    628 }
    629 
    630 BoneState {
    631  Vector3D translation;
    632  Quaternion rotation;
    633 
    634  // the bone's final transform matrix is translation * rotation
    635 }
    636 
    637 PropPoint {
    638  u32 nameLength;
    639  char name[nameLength];
    640  
    641  Vector3D translation;
    642  Quaternion rotation;
    643 
    644  u8 bone;
    645 
    646  // the prop point's final transform matrix is boneTransform * translation * rotation,
    647  // where boneTransform is that of the given bone or identity if no bones are used
    648 }
    649 
    650 Vector3D {
    651  float x, y, z;
    652 }
    653 
    654 Quaternion {
    655  float x, y, z, w;
    656 }
    657 }}}
    658 Some meshes also use PMD version 1. The only difference between this and version 2 is that no prop points are specified (there is no numPropPoints and no propPoints array).
    659 
    660 Some use PMD version 2. These store vertex positions/normals already transformed by the inverse of restStates. That can only work correctly when !VertexBlend has only a single non-zero weight, so PMD version 3 stores vertices in world space instead.
    661 
    662 The algorithm for calculating vertex data under a skeletal animation is:
    663 
    664 {{{
    665 pos = (0,0,0)
    666 norm = (0,0,0)
    667 for i = 0 to 3:
    668  if blend.bones[i] != 0xFF:
    669  inverseRestMatrix = (restStates[blend.bones[i]].translation * restStates[blend.bones[i]].rotation) ^ -1
    670  animatedPoseMatrix = animatedBoneStates[blend.bones[i]].translation * animatedBoneStates[blend.bones[i]].rotation
    671  pos += blend.weights[i] * animatedPoseMatrix * inverseRestMatrix * (position,1)
    672  norm += blend.weights[i] * animatedPoseMatrix * inverseRestMatrix * (normal,0)
    673 norm = normalise(norm)
    674 }}}
     587DATA[[BR]] +MODS[[BR]] +OFFICIAL[[BR]] +ART[[BR]] ¦ACTORS[[BR]] ¦ ¦FAUNA[[BR]] ¦ ¦FLORA[[BR]] ¦ ¦GEOLOGY[[BR]] ¦ ¦PROPS[[BR]] ¦ ¦ ¦FAUNA[[BR]] ¦ ¦ ¦FLORA[[BR]] ¦ ¦ ¦GEOLOGY[[BR]] ¦ ¦ ¦STRUCTURES[[BR]] ¦ ¦ ¦TEMP[[BR]] ¦ ¦ +UNITS[[BR]] ¦ ¦STRUCTURES[[BR]] ¦ ¦TEMP[[BR]] ¦ +UNITS[[BR]] ¦ANIMATION[[BR]] ¦ ¦BIPED[[BR]] ¦ ¦GAIA[[BR]] ¦ ¦MECHANICAL[[BR]] ¦ ¦QUADRAPED[[BR]] ¦ +SIMPLE[[BR]] ¦MATERIALS[[BR]] ¦MESHES[[BR]] ¦ ¦GAIA[[BR]] ¦ ¦PROPS[[BR]] ¦ ¦SKELETAL[[BR]] ¦ ¦STRUCTURAL[[BR]] ¦ ¦TEMP[[BR]] ¦ +TEST[[BR]] ¦SKELETONS[[BR]] +TEXTURES[[BR]] ¦ANIMATED[[BR]] ¦CURSORS[[BR]] ¦PARTICLES[[BR]] ¦SKIES[[BR]] ¦SKINS[[BR]] ¦ ¦GAIA[[BR]] ¦ ¦PROPS[[BR]] ¦ ¦SKELETAL[[BR]] ¦ ¦STRUCTURAL[[BR]] ¦ ¦TEMP[[BR]] ¦ +TEST[[BR]] ¦TERRAIN[[BR]] ¦ ¦ALPHAMAPS[[BR]] ¦ +TYPES[[BR]] +UI
     588