Difference between revisions of "Reference:Mesh2"

From POV-Wiki
Jump to navigation Jump to search
m (1 revision: Initial Load (TF))
 
(indexentry fix)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Objects]]
 
[[Category:Objects]]
 
[[Category:Finite Patch Primitives]]
 
[[Category:Finite Patch Primitives]]
{{#indexentry:vertex_vectors, normal_vectors, uv_vectors}}
+
{{#indexentry:vertex_vectors}}
{{#indexentry:face_indices, normal_indices, uv_indices, texture-list}}
+
{{#indexentry:normal_vectors}}
 +
{{#indexentry:uv_vectors}}
 +
{{#indexentry:face_indices}}
 +
{{#indexentry:normal_indices}}
 +
{{#indexentry:uv_indices}}
 +
{{#indexentry:texture-list}}
 
{{#indexentry:mesh2, keyword}}
 
{{#indexentry:mesh2, keyword}}
 
{{#indexentry:keyword, mesh2}}  
 
{{#indexentry:keyword, mesh2}}  
{{#indexentry:vertex_vectors, mesh2}}
 
 
{{#indexentry:keyword, vertex_vectors}}  
 
{{#indexentry:keyword, vertex_vectors}}  
 
{{#indexentry:normal_vectors, mesh2}}
 
{{#indexentry:normal_vectors, mesh2}}
Line 75: Line 79:
 
</pre>
 
</pre>
  
<p>The <code>mesh2</code> object definition <em>MUST</em> be specified in the following order:</p>
+
<p>Best practices dictate that the <code>mesh2</code> object definition <em>SHOULD</em> be specified in the following order:</p>
 
<ul>
 
<ul>
 
<li>VECTORS</li>
 
<li>VECTORS</li>
Line 81: Line 85:
 
<li>INDICES</li>
 
<li>INDICES</li>
 
</ul>
 
</ul>
 
+
<p>However, the actual implementation also allows the <code>texture_list</code> to be placed <em>BEFORE</em> <code>vertex_vectors</code>.</p>
 
<p>The <code>normal_vectors</code>, <code>uv_vectors</code>, and <code>texture_list</code> sections are optional.  
 
<p>The <code>normal_vectors</code>, <code>uv_vectors</code>, and <code>texture_list</code> sections are optional.  
 
If the number of normals equals the number of vertices then the normal_indices section is optional and the indexes from the <code>face_indices</code> section are used instead. Likewise for the <code>uv_indices</code> section.</p>
 
If the number of normals equals the number of vertices then the normal_indices section is optional and the indexes from the <code>face_indices</code> section are used instead. Likewise for the <code>uv_indices</code> section.</p>

Latest revision as of 23:24, 3 May 2016

The new mesh syntax is designed for use in conversion from other file formats.

MESH2 :
  mesh2{
    VECTORS...
    LISTS...   |
    INDICES... |
    MESH_MODIFIERS
    }
VECTORS :
  vertex_vectors {
  number_of_vertices,
  <vertex1>, <vertex2>, ...
  }|
  normal_vectors {
    number_of_normals,
    <normal1>, <normal2>, ...
    }|
  uv_vectors {
    number_of_uv_vectors,
    <uv_vect1>, <uv_vect2>, ...
    }
LISTS :
  texture_list {
    number_of_textures,
    texture { Texture1 },
    texture { Texture2 }, ...
    }|
INDICES :
  face_indices {
    number_of_faces,
      <index_a, index_b, index_c> [,texture_index [,
    texture_index, texture_index]],
      <index_d, index_e, index_f> [,texture_index [,
      texture_index, texture_index]],
      ...
      }|
  normal_indices {
    number_of_faces,
      <index_a, index_b, index_c>,
      <index_d, index_e, index_f>,
      ...
      }|
  uv_indices {
    number_of_faces,
      <index_a, index_b, index_c>,
      <index_d, index_e, index_f>,
      ...
      }
MESH_MODIFIER :
  inside_vector <direction> | OBJECT_MODIFIERS

Best practices dictate that the mesh2 object definition SHOULD be specified in the following order:

  • VECTORS
  • LISTS
  • INDICES

However, the actual implementation also allows the texture_list to be placed BEFORE vertex_vectors.

The normal_vectors, uv_vectors, and texture_list sections are optional. If the number of normals equals the number of vertices then the normal_indices section is optional and the indexes from the face_indices section are used instead. Likewise for the uv_indices section.

Note: The texture_list section is optional only if face_indices doesn't contain any texture index values.

For example:

face_indices {
  number_of_faces,
  <index_a, index_b, index_c>,
  <index_d, index_e, index_f>,
  ...
  }

Note: The numbers of uv_indices must equal number of faces.

The indexes are zero based, so the first item in each list has an index of zero.

Smooth and Flat triangles in the same mesh

You can specify both flat and smooth triangles in the same mesh. To do this, specify the smooth triangles first in the face_indices section, followed by the flat triangles. Then, specify normal indices (in the normal_indices section) for only the smooth triangles. Any remaining triangles that do not have normal indices associated with them will be assumed to be flat triangles.

Mesh Triangle Textures

To specify a texture for an individual mesh triangle, specify a single integer texture index following the face-index vector for that triangle.

To specify three textures for vertex-texture interpolation, specify three integer texture indices (separated by commas) following the face-index vector for that triangle.

Vertex-texture interpolation and textures for an individual triangle can be mixed in the same mesh.