Meshes
Tellusim SDK provides efficient and comprehensive support for a wide range of mesh formats. It includes not only geometry but also animations, materials, hierarchies, lights, and other scene metadata essential for rendering and simulation.
The Mesh system supports point, line, triangle, quadrilateral, and tetrahedral primitives.
Support for additional Mesh formats can be added via the MeshStream interface.
Supported Mesh Formats
Tellusim Core SDK natively supports the following mesh formats on all platforms:
-
MESH (
*.mesh
) - Native Tellusim format optimized for fast loading and runtime efficiency. Supports all Mesh features, including animation, attachments, materials, and custom attributes. Node transformation matrices can be stored with 32-bit or 64-bit floating-point precision. -
GLTF/GLB (
*.gltf
,*.glb
) - Modern open standard with full support for PBR materials. Supports animations, skeletons, morph targets, and scene hierarchies. -
USD (
*.usd
,*.usda
,*.usdc
) - Universal Scene Description format developed by Pixar. Supports complex scene graphs, instancing, references, metadata, skeletons, and morph targets. -
FBX (
*.fbx
) - Popular format for 3D content pipelines. Supports animations, skeletons, morph targets, embedded materials, and hierarchical structures. -
DAE (COLLADA) (
*.dae
) - Xml-based format designed for asset exchange. Supports meshes, materials, animations, skeletons, morph targets, and physics metadata. -
FLT (OpenFlight) (
*.flt
) - Scene@ format widely used in simulation and training applications. Supports structured scene hierarchies and metadata. -
OBJ (
*.obj
) - Simple and widely adopted format. Supports static geometry with optional material definitions. -
LWO (
*.lwo
) - LightWave Object format. Supports layered meshes, surface attributes, and material data. -
3DS (
*.3ds
) - Legacy Autodesk format. Supports static geometry, basic materials, and simple object hierarchies. -
PLY (
*.ply
) - Polygon format used in 3D scanning and research. Supports custom vertex attributes and point cloud data. -
STL (
*.stl
) - Common format for 3D printing. Contains raw triangle geometry without materials or scene metadata.
Plugin Mesh Formats
The following mesh formats are supported via plugins:
-
Draco (
*.drc
) - Geometry compression format developed by Google. Enables compact storage and efficient transmission. -
GMSH (
*.msh
) - Scientific mesh format used in finite element analysis. Supports line, triangle, quadrilateral, and tetrahedral primitives. -
CityGML (
*.gml
) - Xml-based geospatial format used for 3D terrain and urban models. Includes geographic metadata and coordinate system support.
Example
#include <format/TellusimMesh.h>
// Load mesh
Mesh mesh;
if(!mesh.load("mesh.usd")) return false;
// Mesh nodes
TS_LOGF(Message, "Nodes %u\n", mesh.getNumNodes());
for(const MeshNode &node : mesh.getNodes()) {
TS_LOGT(Message, "{0}: {1} {2} {3} {4}\n", mesh.findNode(node),
node.getName(),
node.getNumChildren(),
node.getNumGeometries(),
mesh.findNode(node.getParent()));
}
// Mesh geometries
TS_LOGF(Message, "Geometries %u\n", mesh.getNumGeometries());
for(const MeshGeometry &geometry : mesh.getGeometries()) {
TS_LOGT(Message, "{0}: <{1}>\n", geometry.getIndex(), geometry.getName());
// Indices
TS_LOGF(Message, " Indices: %u\n", geometry.getNumIndices());
for(uint32_t i = 0; i < geometry.getNumIndices(); i++) {
const MeshIndices &indices = geometry.getIndices(i);
TS_LOGT(Message, " {0}: {1} {2} <{3}> {4}\n", i,
indices.getTypeName(),
indices.getFormatName(),
indices.getName(),
indices.getSize()
);
}
// Attributes
TS_LOGF(Message, " Attributes: %u\n", geometry.getNumAttributes());
for(uint32_t i = 0; i < geometry.getNumAttributes(); i++) {
const MeshAttribute &attribute = geometry.getAttribute(i);
TS_LOGT(Message, " {0}: {1} {2} <{3}> {4} {5}\n", i,
attribute.getTypeName(),
attribute.getFormatName(),
attribute.getName(),
attribute.getSize(),
geometry.findIndices(attribute.getIndices())
);
}
// Materials
TS_LOGF(Message, " Materials: %u\n", geometry.getNumMaterials());
for(uint32_t i = 0; i < geometry.getNumMaterials(); i++) {
const MeshMaterial &material = geometry.getMaterial(i);
TS_LOGT(Message, " {0}: <{1}>\n", i,
material.getName()
);
}
// Joints
TS_LOGF(Message, " Joints: %u\n", geometry.getNumJoints());
for(uint32_t i = 0; i < geometry.getNumJoints(); i++) {
const MeshJoint &joint = geometry.getJoint(i);
TS_LOGT(Message, " {0}: <{1}> {2}\n", i,
joint.getName(),
mesh.findNode(joint.getNode())
);
}
}
// Mesh animations
TS_LOGF(Message, "Animations %u\n", mesh.getNumAnimations());
for(uint32_t i = 0; i < mesh.getNumAnimations(); i++) {
const MeshAnimation &animation = mesh.getAnimation(i);
TS_LOGT(Message, "{0}: <{1}> {2} - {3}\n", i,
animation.getName(),
animation.getMinTime(),
animation.getMaxTime()
);
}