Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

Mesh Class Reference

Mesh presents 3D geometry as a pool of vertices, with each mesh face described by an ordered list vertex indexes. More...

Inheritance diagram for Mesh:

GeometryNode Node IGeometry Object SvgInline Text2D List of all members.

Detailed Description

Mesh presents 3D geometry as a pool of vertices, with each mesh face described by an ordered list vertex indexes.

The range of Mesh descriptions is very flexible, and optimized for maximum graphics hardware performance.

Authoring Interface:

        Mesh {
            field   MFFloat     vertex      []
            field   MFInt32     index       []
            field   SFString    meshType    "TRIANGLE_INDEXED"
            field   MFString    vertexDefinition []
            field   SFString    vertexType  "DYNAMIC_WRITE_ONLY_DISCARDABLE"    // not implemented yet
            field   SFString    indexType   "STATIC_WRITE_ONLY"                 // not implemented yet
            field   SFBoolean           castShadows     true
            field   SFTimerNode         timer           NULL
            field   MFMeshInterpolator  interpolators   [ ]
        }

Parameters:
vertex specifies a list of vertex data, where each vertex entry consists of the number and type of data declared in the vertexDefinition field. Note that each Mesh node can contain a maximum of 65536 indexable vertices. Default value: [ ]
index specifies a list of faces, where each face entry consists of a list of ordered vertex indices, formatted as declared in the meshType field. Faces are skinned with a counter-clockwise ordering of indices. Note that each Mesh node can contain a maximum of 65536 indexable vertices. Default value: [ ]
meshType specifies the format for the index data, interpreted to generate the mesh geometry. Possible mesh format values include:
"POINT_LIST"A list of points, 1 vertex per point
"LINE_LIST"A list of lines, 2 vertices per line
"LINE_STRIP"A strip of connected lines, 1 vertex per line plus 1 start vertex If you specify an index buffer in this mode, the indices are used to specify line segments. For example, if you change a "TRIANGLE_INDEXED" type mesh to "LINE_STRIP", you would see the mesh as wireframe. If an index is not specified, the output looks like a polyline.
"TRIANGLE_STRIP"A strip of triangles, 3 vertices for the first triangle, and 1 per triangle after that
"TRIANGLE_FAN"A fan of triangles, 3 vertices for the first triangle, and 1 per triangle after that
"TRIANGLE_INDEXED"A list of triangles, 3 vertices per triangle. An index buffer specifies the indices of each triangle, every 3 coordIndices adds an independent face
Default value: "TRIANGLE_INDEXED"
vertexDefinition specifies the data format for each vertex entry in the vertex field. The format specification is provided as a list of tuples, one tuple specifying each element of the vertex entry. Each tuple consists of a vertex element type plus a vertex element semantic. The vertex element semantic is used to identify the meaning of each element in the vertex entry. Possible vertex element semantics include:
"POSITION"Position of this vertex; type must be "VEC3F"
"BLEND_WEIGHTS"Blend weights for this vertex
"BLEND_INDICES"Blend indexes for this vertex
"NORMAL"Position at this vertex; type must be "VEC3F"
"DIFFUSE"Diffuse color at this vertex; type must be "COLOR"
"SPECULAR"Specular color at this vertex; type must be "COLOR"
"TEXTURE_COORDINATES"Texture coordinate at this vertex; type must be "VEC2F"
"BINORMAL"Binormal at this vertex (Y axis if normal is Z)
"TANGENT"Tangent (X axis if normal is Z)
The vertex element type is used to identify the number and type of data for each element in the vertex entry. Possible vertex element types include:
"FLOAT"A single floating point value
"VEC2F"Two floating point values
"VEC3F"Three floating point values
"VEC4F"Four floating point values
"COLOR"A single 32-bit value, encoding ARGB color components
So, for example,
vertexDefinition["VEC3F","POSITION","COLOR","DIFFUSE","VEC2F","TEXTURE_COORDINATES"]
specifies a per-vertex entry which includes 3 floats for position, a 32-bit color value for diffuse color, and 2 floats for texture. Default value: [ ]
vertexType specifies a buffer management policy for the vertex field. Used to support advanced optimizations of hardware graphics utilization. See indexType, below, for an enumeration of possible buffer management policy values. Default value: "DYNAMIC_WRITE_ONLY_DISCARDABLE"
indexType specifies a buffer management policy for the index field. Used to support advanced optimizations of hardware graphics utilization. Possible buffer management policy values include:
"STATIC"Static buffer which the application rarely modifies once created. Modifying the contents of this buffer will involve a performance hit.
"DYNAMIC"Indicates the application would like to modify this buffer with the CPU fairly often. Buffers created with this flag will typically end up in AGP memory rather than video memory.
"WRITE_ONLY"Indicates the application will never read the contents of the buffer back, it will only ever write data. Locking a buffer with this flag will ALWAYS return a pointer to new, blank memory rather than the memory associated with the contents of the buffer; this avoids DMA stalls because you can write to a new memory area while the previous one is being used.
"DISCARDABLE"Indicates that the application will be refilling the contents of the buffer regularly (not just updating, but generating the contents from scratch), and therefore does not mind if the contents of the buffer are lost somehow and need to be recreated. This allows and additional level of optimisation on the buffer. This option only really makes sense when combined with DYNAMIC_WRITE_ONLY.
"STATIC_WRITE_ONLY"Combination of STATIC and WRITE_ONLY.
"DYNAMIC_WRITE_ONLY"Combination of DYNAMIC and WRITE_ONLY. If you use this, strongly consider using DYNAMIC_WRITE_ONLY_DISCARDABLE instead if you update the entire contents of the buffer very regularly.
"DYNAMIC_WRITE_ONLY_DISCARDABLE"Combination of DYNAMIC, WRITE_ONLY and DISCARDABLE.
Default value: "STATIC_WRITE_ONLY"
castShadows specifies whether this mesh will cast a shadow when shadow processing is enabled. Default value: true
timer supplies a Timer node to activate and control mesh interpolation. Default value: NULL
interpolators specifies a set of vertex poses, used to animate the vertex data within this Mesh. See MeshInterpolator. Default value: [ ]
Functionality:

XXX To be written


Generated on Sat Apr 1 06:08:09 2006 for Emma Content Development Kit by  doxygen 1.4.3