 |
DATAKIT SDK
V2026.4
|
|
◆ GltfwInstances()
Sample 2: writes 10 re-instanced cubes and a wireframe mesh into a GLTF file, demonstrating geometry instancing.
76 gltfWriter.OpenInstance(
"RootNode", -1, useless );
78 for( instanceIdx = 0; instanceIdx < 10; instanceIdx++ )
80 gltfWriter.OpenInstance(
"Cube", 1, isNewNode, cubetransfo );
83 gltfWriter.WriteMesh( CubeMesh );
85 gltfWriter.CloseLastInstance();
88 gltfWriter.OpenInstance(
"WireMesh", 2, isNewNode,
Dtk_transfo());
91 gltfWriter.WriteMesh(WireMesh);
93 gltfWriter.CloseLastInstance();
95 gltfWriter.CloseLastInstance();
◆ GltfWriteSample()
103 std::cout << std::endl <<
"----------------------------------------------" << std::endl;
106 outputDirectory = inResultDirectory + L
"Gltf/";
108 outputDirectory.
mkdir();
110 std::cout <<
"Gltf Write start" << std::endl;
111 std::cout <<
"sample 1" << std::endl;
113 fileName = outputDirectory + L
"twomeshes.gltf";
116 std::cout <<
"=> " << fileName.
c_str() << std::endl;
120 std::cout <<
"sample 2" << std::endl;
122 fileName = outputDirectory + L
"instances.gltf";
125 std::cout <<
"=> " << fileName.
c_str() << std::endl;
129 std::cout <<
"Gltf Write end" << std::endl;
◆ GltfwTwoMeshes()
Sample 1: writes a cube and a cylinder mesh in a two-node hierarchy into a GLTF file.
32 gltfWriter.OpenInstance(
"RootNode", -1, useless );
35 gltfWriter.OpenInstance(
"Cube", -1, useless );
37 gltfWriter.WriteMesh( CubeMesh );
40 gltfWriter.CloseLastInstance();
43 gltfWriter.OpenInstance(
"Cylinder", -1, useless );
45 gltfWriter.WriteMesh( CylinderMesh );
47 gltfWriter.CloseLastInstance();
50 gltfWriter.CloseLastInstance();
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:207
GLTF Writer main class.
Definition: gltfw.hpp:22
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_ErrorStatus GltfwInstances(const Dtk_string &inOutputFileName)
Sample 2: writes 10 re-instanced cubes and a wireframe mesh into a GLTF file, demonstrating geometry ...
Definition: testlibgltfwrite.cpp:57
char Dtk_bool
Definition: define.h:724
Dtk_MeshPtr CreateMeshWire()
Wire mesh sample.
Definition: testcreatemesh.cpp:389
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Definition: util_ptr_dtk.hpp:37
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
const char * c_str() const
Retrieve the ASCII conversion string.
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:338
int mkdir() const
File Utility : Create a Directory.
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
Dtk_ErrorStatus GltfwTwoMeshes(const Dtk_string &inOutputFileName)
Sample 1: writes a cube and a cylinder mesh in a two-node hierarchy into a GLTF file.
Definition: testlibgltfwrite.cpp:16
void addTranslate(const Dtk_dir &V)
Translate the Dtk_transfo.
@ dtkNoError
Definition: error_dtk.hpp:151
This is a mathematical direction class.
Definition: dtk_dir.hpp:14