TriMesh

Overview

TriMesh is a class in Aspose.3D FOSS for .NET. Inherits from: Entity, INamedObject, IEnumerable<Vertex>.

A TriMesh contains raw data that can be used by GPU directly. This class is a utility to help to construct a mesh that only contains per-vertex data.

This class provides 32 methods for working with TriMesh objects in .NET programs. Available methods include: A3DObject, AddTriangle, BeginVertex, CopyFrom, EndVertex, Entity, FindProperty, FromMesh, FromRawData, GetBoundingBox, GetEntityRendererKey, GetEnumerator, and 20 additional methods. All public members are accessible to any .NET application after installing the Aspose.3D FOSS for .NET package. Properties: Capacity, Excluded, IndicesCount, Name, ParentNode, ParentNodes, and 6 more.

Properties

NameTypeAccessDescription
VertexDeclarationVertexDeclarationReadGets the vertex declaration.
VerticesCountintReadGets the vertices count.
IndicesCountintReadGets the indices count.
UnmergedVerticesCountintReadGets the unmerged vertices count.
CapacityintReadGets the capacity.
VerticesSizeInBytesintReadGets the vertices size in bytes.
ExcludedboolRead/WriteGets or sets the excluded.
ParentNodesList<Node>ReadGets the parent nodes.
ParentNodeNodeRead/WriteGets or sets the parent node.
SceneSceneReadGets the scene.
NamestringRead/WriteGets or sets the name.
PropertiesPropertyCollectionReadGets the properties.

Methods

SignatureDescription
TriMesh(name: string, declaration: VertexDeclaration)
FromMesh(declaration: VertexDeclaration, mesh: Mesh)
CopyFrom(input: TriMesh, vd: VertexDeclaration)
FromMesh(mesh: Mesh, useFloat: bool)
BeginVertex()
EndVertex()
WriteVerticesTo(stream: Stream)
Write16bIndicesTo(stream: Stream)
Write32bIndicesTo(stream: Stream)
VerticesToArray()
IndicesToArray(result: ushort[])
IndicesToArray(result: int[])
ToString()
FromRawData(vd: VertexDeclaration, vertices: byte[], indices: int[], generateVertexMapping: bool)
LoadVerticesFromBytes(verticesInBytes: byte[])
AddTriangle(a: int, b: int, c: int)
GetEnumerator()
ReadVector4(idx: int, field: VertexField)
ReadFVector4(idx: int, field: VertexField)
ReadVector3(idx: int, field: VertexField)
ReadFVector3(idx: int, field: VertexField)
ReadVector2(idx: int, field: VertexField)
ReadFVector2(idx: int, field: VertexField)
ReadDouble(idx: int, field: VertexField)
ReadFloat(idx: int, field: VertexField)
Entity(name: string)
GetBoundingBox()Gets the bounding box of current entity in its object space coordinate system.
GetEntityRendererKey()Gets the key of the entity renderer registered in the renderer
SceneObject(name: string)
A3DObject()
RemoveProperty(property: Property)Removes a dynamic property.
GetProperty(property: string)Get the value of specified property
SetProperty(property: string, value: object?)Sets the value of specified property
FindProperty(propertyName: string)Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)

See Also