    

 ## On this page

  

 

 # Test013

 Last update: 16.07.2025 

Legends

This example demonstrates the use of legends.

Several legends are created demonstrating different options to the legend object. &lt;script src="/ansys/nexus/viewer-loader.js"&gt;&lt;/script&gt;

/\*

 \* Copyright 2018-2021 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.

 \* 

 \* Restricted Rights Legend

 \*

 \* Use, duplication, or disclosure of this

 \* software and its documentation by the

 \* Government is subject to restrictions as

 \* set forth in subdivision \[(b)(3)(ii)\] of

 \* the Rights in Technical Data and Computer

 \* Software clause at 52.227-7013.

 \*/

\#include &lt;vector&gt;

\#include &lt;cmath&gt;

\#ifdef \_WIN32

\#include &lt;codecvt&gt;

\#endif

 

\#include "GLTFWriter.h"

\#include "test.h"

 

using namespace ANSYS::Nexus;

 

namespace {

\#ifdef \_WIN32

 std::string 

 ConvertToUtf8String(const std::wstring&amp; wstr)

 {

 std::wstring_convert&lt;std::codecvt_utf8&lt;wchar_t&gt;&gt; myconv;

 return myconv.to_bytes(wstr);

 }

\#endif

};

 

// Legends

TESTFUNC(Legends)

{

 GLTFWriter::GLTF *gltf = <a id="a0" name="a0"></a>[GLTFWriter::GLTF::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#ab7ba6d114c76cb60baf41aa6f13e9494)("MyApp", "1.0", functionName.c_str(), type);

 if (!gltf)

 throw std::runtime_error("Can't create GLTF");

 

 // SCENE

\#ifdef \_WIN32

 GLTFWriter::Scene *scene = <a id="a1" name="a1"></a>[GLTFWriter::Scene::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_scene.xhtml#aac8bcb85d4361abba99053b3c56eb08b)(gltf, ConvertToUtf8String(L"ԎҿșϯϨҁęɳę").c_str(), "", 0, <a id="a2" name="a2"></a>[GLTFWriter::Scene::BT\_TB](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_scene.xhtml#ac17baf491cdba3613b0aa39719a3dbd8a0e9df8d9774401657f9d7aad4e18728f), 0.42F, 0.55F, 0.871F, 1, 1, 1);

\#else

 GLTFWriter::Scene *scene = [GLTFWriter::Scene::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_scene.xhtml#aac8bcb85d4361abba99053b3c56eb08b)(gltf, "Testscene", "m", 1.0F, [GLTFWriter::Scene::BT\_TB](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_scene.xhtml#ac17baf491cdba3613b0aa39719a3dbd8a0e9df8d9774401657f9d7aad4e18728f), 0.42F, 0.55F, 0.871F, 1, 1, 1);

\#endif

 if (!scene) {

 <a id="a3" name="a3"></a>[GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create scene");

 }

 

 // CAMERA

 {

 // CAMERA

 GLTFWriter::Camera *camera = <a id="a4" name="a4"></a>[GLTFWriter::Camera::CreateOrthographic](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_camera.xhtml#acab0b8344a7bb8b65c9690d221705377)(gltf);

 // CAMERA NODE

 std::vector&lt;double&gt; mat(16);

 mat[0] = 0;

 mat[1] = 1;

 mat[2] = 0;

 mat[3] = 0;

 mat[4] = 0;

 mat[5] = 0;

 mat[6] = 1;

 mat[7] = 0;

 mat[8] = 1;

 mat[9] = 0;

 mat[10] = 0;

 mat[11] = 0;

 mat[12] = 0;

 mat[13] = 0;

 mat[14] = 0;

 mat[15] = 1;

 GLTFWriter::Node *cameraNode = <a id="a5" name="a5"></a>[GLTFWriter::Node::CreateCamera](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#af6c4767cc8271d9d39816d278538197a)(gltf, camera, "TestCamera", &amp;mat[0]);

 scene-&gt;SetCamera(cameraNode);

 }

 

 // banded texture

 {

 float mn = 1.5;

 float mx = 2.5;

 float range = mx - mn;

 

 // TEXTURE

 std::vector&lt;unsigned char&gt; colors;

 colors.push_back(0); colors.push_back(0); colors.push_back(255); // blue

 colors.push_back(0); colors.push_back(255); colors.push_back(255); // cyan

 colors.push_back(0); colors.push_back(255); colors.push_back(0); // green

 colors.push_back(255); colors.push_back(255); colors.push_back(0); // yellow

 colors.push_back(255); colors.push_back(0); colors.push_back(0); // red

 GLTFWriter::Texture *bandedTexture = <a id="a6" name="a6"></a>[GLTFWriter::Texture::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#a3d15e0e6ad83cd7d50bb81ce2d0f30c8)(gltf, <a id="a7" name="a7"></a>[GLTFWriter::Texture::TF\_RGB](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964aaa8ea9a0e6b83932a6a882b1655e8e59), (unsigned int)colors.size() / 3, &amp;colors[0], false);

 

 

 // generate vertices, and texture coordinates for a ball

 std::vector&lt;float&gt; vertices;

 std::vector&lt;unsigned int&gt; lines;

 std::vector&lt;unsigned int&gt; triangles;

 GLTFWriter::Test::MakeSphere(0, -1, 0, 0.5, 64, vertices, lines, triangles);

 const unsigned int numVertices = (unsigned int)vertices.size() / 3;

 const unsigned int numLines = (unsigned int)lines.size() / 2;

 const unsigned int numTriangles = (unsigned int)triangles.size() / 3;

 std::vector&lt;float&gt; textureCoords(numVertices);

 for (unsigned int i = 0; i &lt; numVertices; ++i)

 textureCoords[i] = (vertices[3 * i + 2] + 0.5F) * range + mn; // coordinates go from mn to mx

 

 // NODE

 {

 // LEGEND

 // make this banded colors

 std::vector&lt;float&gt; valueLocation;

 //valueLocation.push\_back(1, mx);

 GLTFWriter::Legend *legend = <a id="a8" name="a8"></a>[GLTFWriter::Legend::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a4538d9a6db05a532b33fccad579ec90e)(gltf, <a id="a9" name="a9"></a>[GLTFWriter::Legend::LO\_VERTICAL](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a339aacb19b79675bd3bc9a903349d933ae89817b11c6c1230e3a9b56d04d402fa), 0.75, bandedTexture, mn, mx, <a id="a10" name="a10"></a>[GLTFWriter::Legend::LA\_X\_YCENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a96892dc857e05a292528ddc6c29a6ea2a78c88258f5d9a3a003e6bb1d49446c3b),

\#ifdef _WIN32

 ConvertToUtf8String(L"Z Ƥṏᴤΐṱϊӧת\\nBanded").c_str(), 

\#else

 "Z Position\\nBanded",

\#endif

 "m", "This is an example\\nbanded legend\\nX, Y Center", 6, 0,

 true, false, 0.05F, 0, 0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.25F);

 

 // BUFFER - combine attributes into a single buffer

 GLTFWriter::Buffer *buffer = <a id="a11" name="a11"></a>[GLTFWriter::Buffer::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_buffer.xhtml#ab3810e93f82a461a858df95e572b221d)(gltf);

 if (!buffer) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create buffer");

 }

 

 // NODE

 GLTFWriter::Node *node = <a id="a12" name="a12"></a>[GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)(gltf, "Banded");

 if (!node || !scene-&gt;AppendMesh(node)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh node");

 }

 

 // LEGEND NODE

\#ifdef \_WIN32

 GLTFWriter::Node *legendNode = <a id="a13" name="a13"></a>[GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)(gltf, legend, ConvertToUtf8String(L"Ḷḙḡḗṋḍ").c_str());

\#else

 GLTFWriter::Node *legendNode = [GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)(gltf, legend, "Legend");

\#endif

 node-&gt;AppendChild(legendNode);

 

 

 // MESH NODE

 GLTFWriter::Node *meshNode = [GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)(gltf, "Mesh");

 if (!meshNode || !node-&gt;AppendChild(meshNode)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh node");

 }

 

 // MESH

 GLTFWriter::Mesh *mesh = <a id="a14" name="a14"></a>[GLTFWriter::Mesh::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_mesh.xhtml#a9f7803b1b1eb72e4005665ca33f42788)(gltf);

 if (!mesh || !meshNode-&gt;AppendMesh(mesh)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh");

 }

 

 // TECHNIQUE

 GLTFWriter::Technique *technique = <a id="a15" name="a15"></a>[GLTFWriter::Technique::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_technique.xhtml#a13382537cb3622195e7cf0bf33e202c2)(gltf);

 if (!technique ||

 // TECHNIQUE STATES

 !technique-&gt;AppendState(<a id="a16" name="a16"></a>[GLTFWriter::State::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#a8cefd28a7477d1ab51809a51b21b8019)(gltf, <a id="a17" name="a17"></a>[GLTFWriter::State::ST\_DEPTHTESTENABLE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#affd67e37265c1883f760fd0c368ba718a5a304a50ef0c9a98124f4c998ec47f3b), 1))) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create technique");

 }

 

 // MATERIAL

 GLTFWriter::Material *material = <a id="a18" name="a18"></a>[GLTFWriter::Material::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_material.xhtml#a683cf8ee4a674e8e7a7b01c97797eecc)(gltf, technique);

 if (!material ||

 // MATERIAL UNIFORM VALUES

 !material-&gt;AppendValue(<a id="a19" name="a19"></a>[GLTFWriter::Value::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_value.xhtml#aee78dae95614f843f10d5e19f9d55d61)(gltf, "texture0", bandedTexture-&gt;GetID()))) { // texture0 name is auto-generated from Attribute TEXCOORD0

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create material");

 }

 

 // repack unsigned int indices into multiple sets of unsigned short indices

 GLTFWriter::Utils::Repack *repack = <a id="a20" name="a20"></a>[GLTFWriter::Utils::Repack::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#a81856527dc12542540dce2f517b5eec4)(numTriangles, 3, &amp;triangles[0]);

 if (!repack) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create repack");

 }

 for (unsigned int i = 0; i &lt; repack-&gt;NumPacks(); ++i) {

 const float *packedData;

 unsigned int numAttributes = repack-&gt;NumAttributes(i);

 

 // POSITION ATTRIBUTE

 packedData = repack-&gt;ConstructRepackAttribute(&amp;triangles[0], 3, &amp;vertices[0], i);

 GLTFWriter::Attribute *vertex = <a id="a21" name="a21"></a>[GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)(gltf, "POSITION", <a id="a22" name="a22"></a>[GLTFWriter::Attribute::AT\_FLOAT\_VEC3](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba0e6049e71b78dccf0f7f9791abe541c3), numAttributes, packedData, buffer);

 

 // TEXCOORD ATTRIBUTE

 packedData = repack-&gt;ConstructRepackAttribute(&amp;triangles[0], 1, &amp;textureCoords[0], i);

 GLTFWriter::Attribute *texture = [GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)(gltf, "TEXCOORD0", <a id="a23" name="a23"></a>[GLTFWriter::Attribute::AT\_FLOAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba6d124c894e5bdc043eeebec0f852e857), numAttributes, packedData, buffer);

 

 // INDICES

 unsigned int numIndices = 3U * repack-&gt;NumElements(i);

 const unsigned short *packedIndex = repack-&gt;ConstructRepackIndex(&amp;triangles[0], i);

 GLTFWriter::Index *index = <a id="a24" name="a24"></a>[GLTFWriter::Index::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_index.xhtml#ab4c4a14b880b4247257672358ad7ccfc)(gltf, numIndices, packedIndex, buffer);

 

 // PRIMITIVE

 GLTFWriter::Primitive *primitive = <a id="a25" name="a25"></a>[GLTFWriter::Primitive::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a11dce37f59247e26bd6973ba5d7fefeb)(gltf, <a id="a26" name="a26"></a>[GLTFWriter::Primitive::PT\_TRIANGLES](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea85ba263ad510a4b423c5e1452fd5ca7d), material, index);

 if (!primitive ||

 !mesh-&gt;AppendPrimitive(primitive) ||

 !primitive-&gt;AppendAttribute(vertex) ||

 !primitive-&gt;AppendAttribute(texture)) {

 <a id="a27" name="a27"></a>[GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)(repack);

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create primitive");

 }

 }

 

 [GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)(repack);

 }

 }

 

 // gradient texture

 {

 float mn = -0.5;

 float mx = 0.5;

 float range = mx - mn;

 

 // TEXTURE

 std::vector&lt;unsigned char&gt; colors;

 colors.push_back(0); colors.push_back(0); colors.push_back(255); // blue

 colors.push_back(0); colors.push_back(255); colors.push_back(255); // cyan

 colors.push_back(0); colors.push_back(255); colors.push_back(0); // green

 colors.push_back(255); colors.push_back(255); colors.push_back(0); // yellow

 colors.push_back(255); colors.push_back(0); colors.push_back(0); // red

 GLTFWriter::Texture *smoothTexture = [GLTFWriter::Texture::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#a3d15e0e6ad83cd7d50bb81ce2d0f30c8)(gltf, [GLTFWriter::Texture::TF\_RGB](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964aaa8ea9a0e6b83932a6a882b1655e8e59), (unsigned int)colors.size() / 3, &amp;colors[0]);

 

 // generate vertices, and texture coordinates for a ball

 std::vector&lt;float&gt; vertices;

 std::vector&lt;unsigned int&gt; lines;

 std::vector&lt;unsigned int&gt; triangles;

 GLTFWriter::Test::MakeSphere(0, 1, 0, 0.5, 64, vertices, lines, triangles);

 const unsigned int numVertices = (unsigned int)vertices.size() / 3;

 const unsigned int numLines = (unsigned int)lines.size() / 2;

 const unsigned int numTriangles = (unsigned int)triangles.size() / 3;

 std::vector&lt;float&gt; textureCoords(numVertices);

 for (unsigned int i = 0; i &lt; numVertices; ++i)

 textureCoords[i] = (vertices[3 * i + 2] + 0.5F) * range + mn; // coordinates go from mn to mx

 

 // NODE

 {

 // LEGEND

 // make this gradient colors

 std::vector&lt;float&gt; valueLocation;

 //valueLocation.push\_back(1, mx);

 GLTFWriter::Legend *legend = [GLTFWriter::Legend::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a4538d9a6db05a532b33fccad579ec90e)(gltf, [GLTFWriter::Legend::LO\_VERTICAL](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a339aacb19b79675bd3bc9a903349d933ae89817b11c6c1230e3a9b56d04d402fa), 0.333F, smoothTexture, mn, mx, <a id="a28" name="a28"></a>[GLTFWriter::Legend::LA\_XRIGHT\_YCENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a96892dc857e05a292528ddc6c29a6ea2a74c6997c4d92c6b6c95e67dbe827fe32),

\#ifdef _WIN32

 ConvertToUtf8String(L"Z Ƥṏᴤΐṱϊӧת\\nSmooth").c_str(),

\#else

 "Z Position\\nSmooth",

\#endif

 "m", "This is an example\\ngradient legend\\nX Right, Y Center", 0, 0,

 false, false);

 

 // BUFFER - combine attributes into a single buffer

 GLTFWriter::Buffer *buffer = [GLTFWriter::Buffer::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_buffer.xhtml#ab3810e93f82a461a858df95e572b221d)(gltf);

 

 // NODE

 GLTFWriter::Node *node = [GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)(gltf, "Linear");

 if (!node || !scene-&gt;AppendMesh(node)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh node");

 }

 

 // LEGEND NODE

\#ifdef \_WIN32

 GLTFWriter::Node *legendNode = [GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)(gltf, legend, ConvertToUtf8String(L"Ḷḙḡḗṋḍ").c_str());

\#else

 GLTFWriter::Node *legendNode = [GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)(gltf, legend, "Legend");

\#endif

 node-&gt;AppendChild(legendNode);

 

 // MESH NODE

 GLTFWriter::Node *meshNode = [GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)(gltf, "Mesh");

 if (!meshNode || !node-&gt;AppendChild(meshNode)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh node");

 }

 

 // MESH

 GLTFWriter::Mesh *mesh = [GLTFWriter::Mesh::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_mesh.xhtml#a9f7803b1b1eb72e4005665ca33f42788)(gltf);

 if (!mesh || !meshNode-&gt;AppendMesh(mesh)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh");

 }

 

 // TECHNIQUE

 GLTFWriter::Technique *technique = [GLTFWriter::Technique::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_technique.xhtml#a13382537cb3622195e7cf0bf33e202c2)(gltf);

 if (!technique ||

 // TECHNIQUE STATES

 !technique-&gt;AppendState([GLTFWriter::State::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#a8cefd28a7477d1ab51809a51b21b8019)(gltf, [GLTFWriter::State::ST\_DEPTHTESTENABLE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#affd67e37265c1883f760fd0c368ba718a5a304a50ef0c9a98124f4c998ec47f3b), 1))) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create technique");

 }

 

 // MATERIAL

 GLTFWriter::Material *material = [GLTFWriter::Material::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_material.xhtml#a683cf8ee4a674e8e7a7b01c97797eecc)(gltf, technique);

 if (!material ||

 // MATERIAL UNIFORM VALUES

 !material-&gt;AppendValue([GLTFWriter::Value::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_value.xhtml#aee78dae95614f843f10d5e19f9d55d61)(gltf, "texture0", smoothTexture-&gt;GetID()))) { // texture0 name is auto-generated from Attribute TEXCOORD0

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create material");

 }

 

 // repack unsigned int indices into multiple sets of unsigned short indices

 GLTFWriter::Utils::Repack *repack = [GLTFWriter::Utils::Repack::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#a81856527dc12542540dce2f517b5eec4)(numTriangles, 3, &amp;triangles[0]);

 if (!repack) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create repack");

 }

 for (unsigned int i = 0; i &lt; repack-&gt;NumPacks(); ++i) {

 const float *packedData;

 unsigned int numAttributes = repack-&gt;NumAttributes(i);

 

 // POSITION ATTRIBUTE

 packedData = repack-&gt;ConstructRepackAttribute(&amp;triangles[0], 3, &amp;vertices[0], i);

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)(gltf, "POSITION", [GLTFWriter::Attribute::AT\_FLOAT\_VEC3](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba0e6049e71b78dccf0f7f9791abe541c3), numAttributes, packedData, buffer);

 

 // TEXCOORD ATTRIBUTE

 packedData = repack-&gt;ConstructRepackAttribute(&amp;triangles[0], 1, &amp;textureCoords[0], i);

 GLTFWriter::Attribute *texture = [GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)(gltf, "TEXCOORD0", [GLTFWriter::Attribute::AT\_FLOAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba6d124c894e5bdc043eeebec0f852e857), numAttributes, packedData, buffer);

 

 // INDICES

 unsigned int numIndices = 3U * repack-&gt;NumElements(i);

 const unsigned short *packedIndex = repack-&gt;ConstructRepackIndex(&amp;triangles[0], i);

 GLTFWriter::Index *index = [GLTFWriter::Index::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_index.xhtml#ab4c4a14b880b4247257672358ad7ccfc)(gltf, numIndices, packedIndex, buffer);

 

 // PRIMITIVE

 GLTFWriter::Primitive *primitive = [GLTFWriter::Primitive::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a11dce37f59247e26bd6973ba5d7fefeb)(gltf, [GLTFWriter::Primitive::PT\_TRIANGLES](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea85ba263ad510a4b423c5e1452fd5ca7d), material, index);

 if (!primitive ||

 !mesh-&gt;AppendPrimitive(primitive) ||

 !primitive-&gt;AppendAttribute(vertex) ||

 !primitive-&gt;AppendAttribute(texture)) {

 [GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)(repack);

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create primitive");

 }

 }

 

 [GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)(repack);

 }

 }

 

 // banded log texture

 {

 float mn = 10;

 float mx = 100;

 float range = mx - mn;

 

 // TEXTURE

 std::vector&lt;unsigned char&gt; colors;

 colors.push_back(0); colors.push_back(0); colors.push_back(255); // blue

 colors.push_back(0); colors.push_back(255); colors.push_back(255); // cyan

 colors.push_back(0); colors.push_back(255); colors.push_back(0); // green

 colors.push_back(255); colors.push_back(255); colors.push_back(0); // yellow

 colors.push_back(255); colors.push_back(0); colors.push_back(0); // red

 

 std::vector&lt;float&gt; bandLocations; // fractions from 0 to 1

 bandLocations.push_back(0);

 bandLocations.push_back(0.064988132F);

 bandLocations.push_back(0.167987381F);

 bandLocations.push_back(0.33123019F);

 bandLocations.push_back(0.589952605F);

 GLTFWriter::Texture *bandedTexture = [GLTFWriter::Texture::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#a3d15e0e6ad83cd7d50bb81ce2d0f30c8)(gltf, [GLTFWriter::Texture::TF\_RGB](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964aaa8ea9a0e6b83932a6a882b1655e8e59), (unsigned int)colors.size() / 3, &amp;colors[0], false, (unsigned int)bandLocations.size(), &amp;bandLocations[0]);

 

 // generate vertices, and texture coordinates for a ball

 std::vector&lt;float&gt; vertices;

 std::vector&lt;unsigned int&gt; lines;

 std::vector&lt;unsigned int&gt; triangles;

 GLTFWriter::Test::MakeSphere(0, 0, -1, 0.5, 64, vertices, lines, triangles);

 const unsigned int numVertices = (unsigned int)vertices.size() / 3;

 const unsigned int numLines = (unsigned int)lines.size() / 2;

 const unsigned int numTriangles = (unsigned int)triangles.size() / 3;

 std::vector&lt;float&gt; textureCoords(numVertices);

 for (unsigned int i = 0; i &lt; numVertices; ++i)

 textureCoords[i] = (vertices[3 * i + 1] + 0.5F) * range + mn; // coordinates go from mn to mx

 

 // NODE

 {

 // LEGEND

 // make this logarithmic with banded colors

 std::vector&lt;float&gt; valueLocations; // pairs of numbers, both of which are fractions from 0 to 1

 valueLocations.push_back(0); valueLocations.push_back(0);

 valueLocations.push_back((15.84893192461114F - mn) / range); valueLocations.push_back(0.2F);

 valueLocations.push_back((25.1188643150958F - mn) / range); valueLocations.push_back(0.4F);

 valueLocations.push_back((39.8107170553498F - mn) / range); valueLocations.push_back(0.6F);

 valueLocations.push_back((63.0957344480194F - mn) / range); valueLocations.push_back(0.8F);

 valueLocations.push_back(1); valueLocations.push_back(1);

 GLTFWriter::Legend *legend = [GLTFWriter::Legend::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a4538d9a6db05a532b33fccad579ec90e)(gltf, <a id="a29" name="a29"></a>[GLTFWriter::Legend::LO\_HORIZONTAL](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a339aacb19b79675bd3bc9a903349d933aff8809926fbf87a325921ca8ab072a48), 0.75, bandedTexture, mn, mx, <a id="a30" name="a30"></a>[GLTFWriter::Legend::LA\_XCENTER\_YBOTTOM](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a96892dc857e05a292528ddc6c29a6ea2a1c6ecc55be42d96e2a0526d71fd51c9b),

\#ifdef _WIN32

 ConvertToUtf8String(L"Y Ƥṏᴤΐṱϊӧת\\nBanded").c_str(),

\#else

 "Y Position\\nBanded",

\#endif

 "m", "User specified\\nbanded log legend\\nX Center, Y Bottom", 6, &amp;valueLocations[0],

 false, false, 0, 0, 0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.25F);

 

 // BUFFER - combine attributes into a single buffer

 GLTFWriter::Buffer *buffer = [GLTFWriter::Buffer::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_buffer.xhtml#ab3810e93f82a461a858df95e572b221d)(gltf);

 

 // NODE

 GLTFWriter::Node *node = [GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)(gltf, "Banded Log User Specified");

 if (!node || !scene-&gt;AppendMesh(node)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh node");

 }

 

 // LEGEND NODE

\#ifdef \_WIN32

 GLTFWriter::Node *legendNode = [GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)(gltf, legend, ConvertToUtf8String(L"Ḷḙḡḗṋḍ").c_str());

\#else

 GLTFWriter::Node *legendNode = [GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)(gltf, legend, "Legend");

\#endif

 node-&gt;AppendChild(legendNode);

 

 // MESH NODE

 GLTFWriter::Node *meshNode = [GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)(gltf, "Mesh");

 if (!meshNode || !node-&gt;AppendChild(meshNode)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh node");

 }

 

 // MESH

 GLTFWriter::Mesh *mesh = [GLTFWriter::Mesh::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_mesh.xhtml#a9f7803b1b1eb72e4005665ca33f42788)(gltf);

 if (!mesh || !meshNode-&gt;AppendMesh(mesh)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh");

 }

 

 // TECHNIQUE

 GLTFWriter::Technique *technique = [GLTFWriter::Technique::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_technique.xhtml#a13382537cb3622195e7cf0bf33e202c2)(gltf);

 if (!technique ||

 // TECHNIQUE STATES

 !technique-&gt;AppendState([GLTFWriter::State::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#a8cefd28a7477d1ab51809a51b21b8019)(gltf, [GLTFWriter::State::ST\_DEPTHTESTENABLE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#affd67e37265c1883f760fd0c368ba718a5a304a50ef0c9a98124f4c998ec47f3b), 1))) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create technique");

 }

 

 // MATERIAL

 GLTFWriter::Material *material = [GLTFWriter::Material::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_material.xhtml#a683cf8ee4a674e8e7a7b01c97797eecc)(gltf, technique);

 if (!material ||

 // MATERIAL UNIFORM VALUES

 !material-&gt;AppendValue([GLTFWriter::Value::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_value.xhtml#aee78dae95614f843f10d5e19f9d55d61)(gltf, "texture0", bandedTexture-&gt;GetID()))) { // texture0 name is auto-generated from Attribute TEXCOORD0

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create material");

 }

 

 // repack unsigned int indices into multiple sets of unsigned short indices

 GLTFWriter::Utils::Repack *repack = [GLTFWriter::Utils::Repack::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#a81856527dc12542540dce2f517b5eec4)(numTriangles, 3, &amp;triangles[0]);

 if (!repack) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create repack");

 }

 for (unsigned int i = 0; i &lt; repack-&gt;NumPacks(); ++i) {

 const float *packedData;

 unsigned int numAttributes = repack-&gt;NumAttributes(i);

 

 // POSITION ATTRIBUTE

 packedData = repack-&gt;ConstructRepackAttribute(&amp;triangles[0], 3, &amp;vertices[0], i);

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)(gltf, "POSITION", [GLTFWriter::Attribute::AT\_FLOAT\_VEC3](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba0e6049e71b78dccf0f7f9791abe541c3), numAttributes, packedData, buffer);

 

 // TEXCOORD ATTRIBUTE

 packedData = repack-&gt;ConstructRepackAttribute(&amp;triangles[0], 1, &amp;textureCoords[0], i);

 GLTFWriter::Attribute *texture = [GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)(gltf, "TEXCOORD0", [GLTFWriter::Attribute::AT\_FLOAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba6d124c894e5bdc043eeebec0f852e857), numAttributes, packedData, buffer);

 

 // INDICES

 unsigned int numIndices = 3U * repack-&gt;NumElements(i);

 const unsigned short *packedIndex = repack-&gt;ConstructRepackIndex(&amp;triangles[0], i);

 GLTFWriter::Index *index = [GLTFWriter::Index::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_index.xhtml#ab4c4a14b880b4247257672358ad7ccfc)(gltf, numIndices, packedIndex, buffer);

 

 // PRIMITIVE

 GLTFWriter::Primitive *primitive = [GLTFWriter::Primitive::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a11dce37f59247e26bd6973ba5d7fefeb)(gltf, [GLTFWriter::Primitive::PT\_TRIANGLES](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea85ba263ad510a4b423c5e1452fd5ca7d), material, index);

 if (!primitive ||

 !mesh-&gt;AppendPrimitive(primitive) ||

 !primitive-&gt;AppendAttribute(vertex) ||

 !primitive-&gt;AppendAttribute(texture)) {

 [GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)(repack);

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create primitive");

 }

 }

 

 [GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)(repack);

 }

 }

 

 // gradient log texture

 // we need to fudge the texture, because auto generated shaders do not support logging of data

 {

 float mn = 10;

 float mx = 100;

 float range = mx - mn;

 

 // TEXTURE

 std::vector&lt;unsigned char&gt; colors;

 colors.push_back(0); colors.push_back(0); colors.push_back(255); // blue

 colors.push_back(0); colors.push_back(255); colors.push_back(255); // cyan

 colors.push_back(0); colors.push_back(255); colors.push_back(0); // green

 colors.push_back(255); colors.push_back(255); colors.push_back(0); // yellow

 colors.push_back(255); colors.push_back(0); colors.push_back(0); // red

 

 // create a gradient texture that is really made up of bands

 const unsigned int numBands = 256;

 std::vector&lt;float&gt; bandLocations; // fractions from 0 to 1

 for (unsigned int i = 0; i &lt; numBands; ++i)

 bandLocations.push_back((float)(pow(10.0, (double)i / numBands) * 10.0 - mn) / range);

 

 GLTFWriter::Texture *smoothTexture = [GLTFWriter::Texture::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#a3d15e0e6ad83cd7d50bb81ce2d0f30c8)(gltf, [GLTFWriter::Texture::TF\_RGB](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964aaa8ea9a0e6b83932a6a882b1655e8e59), (unsigned int)colors.size() / 3, &amp;colors[0], false, (unsigned int)bandLocations.size(), &amp;bandLocations[0]);

 

 // generate vertices, and texture coordinates for a ball

 std::vector&lt;float&gt; vertices;

 std::vector&lt;unsigned int&gt; lines;

 std::vector&lt;unsigned int&gt; triangles;

 GLTFWriter::Test::MakeSphere(0, 0, 1, 0.5, 64, vertices, lines, triangles);

 const unsigned int numVertices = (unsigned int)vertices.size() / 3;

 const unsigned int numLines = (unsigned int)lines.size() / 2;

 const unsigned int numTriangles = (unsigned int)triangles.size() / 3;

 std::vector&lt;float&gt; textureCoords(numVertices);

 for (unsigned int i = 0; i &lt; numVertices; ++i)

 textureCoords[i] = (vertices[3 * i + 1] + 0.5F) * range + mn; // coordinates go from mn to mx

 

 // NODE

 {

 // LEGEND

 GLTFWriter::Legend *legend = [GLTFWriter::Legend::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a4538d9a6db05a532b33fccad579ec90e)(gltf, [GLTFWriter::Legend::LO\_HORIZONTAL](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a339aacb19b79675bd3bc9a903349d933aff8809926fbf87a325921ca8ab072a48), 0.333F, smoothTexture, mn, mx, <a id="a31" name="a31"></a>[GLTFWriter::Legend::LA\_XCENTER\_YTOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a96892dc857e05a292528ddc6c29a6ea2a546848f232c0cb79a70516945e7f367e),

\#ifdef _WIN32

 ConvertToUtf8String(L"Y Ƥṏᴤΐṱϊӧת\\nGradient").c_str(),

\#else

 "Y Position\\nGradient",

\#endif

 "m", "This is an example\\ngradient log legend\\nX Center, Y Top", 0, 0,

 true, true, 0, 0, 0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.25F);

 

 // BUFFER - combine attributes into a single buffer

 GLTFWriter::Buffer *buffer = [GLTFWriter::Buffer::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_buffer.xhtml#ab3810e93f82a461a858df95e572b221d)(gltf);

 

 // NODE

 GLTFWriter::Node *node = [GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)(gltf, "Gradient Log");

 if (!node || !scene-&gt;AppendMesh(node)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh node");

 }

 

 // LEGEND NODE

\#ifdef \_WIN32

 GLTFWriter::Node *legendNode = [GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)(gltf, legend, ConvertToUtf8String(L"Ḷḙḡḗṋḍ").c_str());

\#else

 GLTFWriter::Node *legendNode = [GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)(gltf, legend, "Legend");

\#endif

 node-&gt;AppendChild(legendNode);

 

 // MESH NODE

 GLTFWriter::Node *meshNode = [GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)(gltf, "Mesh");

 if (!meshNode || !node-&gt;AppendChild(meshNode)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh node");

 }

 

 // MESH

 GLTFWriter::Mesh *mesh = [GLTFWriter::Mesh::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_mesh.xhtml#a9f7803b1b1eb72e4005665ca33f42788)(gltf);

 if (!mesh || !meshNode-&gt;AppendMesh(mesh)) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create mesh");

 }

 

 // TECHNIQUE

 GLTFWriter::Technique *technique = [GLTFWriter::Technique::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_technique.xhtml#a13382537cb3622195e7cf0bf33e202c2)(gltf);

 if (!technique ||

 // TECHNIQUE STATES

 !technique-&gt;AppendState([GLTFWriter::State::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#a8cefd28a7477d1ab51809a51b21b8019)(gltf, [GLTFWriter::State::ST\_DEPTHTESTENABLE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#affd67e37265c1883f760fd0c368ba718a5a304a50ef0c9a98124f4c998ec47f3b), 1))) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create technique");

 }

 

 // MATERIAL

 GLTFWriter::Material *material = [GLTFWriter::Material::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_material.xhtml#a683cf8ee4a674e8e7a7b01c97797eecc)(gltf, technique);

 if (!material ||

 // MATERIAL UNIFORM VALUES

 !material-&gt;AppendValue([GLTFWriter::Value::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_value.xhtml#aee78dae95614f843f10d5e19f9d55d61)(gltf, "texture0", smoothTexture-&gt;GetID()))) { // texture0 name is auto-generated from Attribute TEXCOORD0

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create material");

 }

 

 // repack unsigned int indices into multiple sets of unsigned short indices

 GLTFWriter::Utils::Repack *repack = [GLTFWriter::Utils::Repack::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#a81856527dc12542540dce2f517b5eec4)(numTriangles, 3, &amp;triangles[0]);

 if (!repack) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create repack");

 }

 for (unsigned int i = 0; i &lt; repack-&gt;NumPacks(); ++i) {

 const float *packedData;

 unsigned int numAttributes = repack-&gt;NumAttributes(i);

 

 // POSITION ATTRIBUTE

 packedData = repack-&gt;ConstructRepackAttribute(&amp;triangles[0], 3, &amp;vertices[0], i);

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)(gltf, "POSITION", [GLTFWriter::Attribute::AT\_FLOAT\_VEC3](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba0e6049e71b78dccf0f7f9791abe541c3), numAttributes, packedData, buffer);

 

 // TEXCOORD ATTRIBUTE

 packedData = repack-&gt;ConstructRepackAttribute(&amp;triangles[0], 1, &amp;textureCoords[0], i);

 GLTFWriter::Attribute *texture = [GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)(gltf, "TEXCOORD0", [GLTFWriter::Attribute::AT\_FLOAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba6d124c894e5bdc043eeebec0f852e857), numAttributes, packedData, buffer);

 texture-&gt;SetLogarithmic(true);

 

 // INDICES

 unsigned int numIndices = 3U * repack-&gt;NumElements(i);

 const unsigned short *packedIndex = repack-&gt;ConstructRepackIndex(&amp;triangles[0], i);

 GLTFWriter::Index *index = [GLTFWriter::Index::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_index.xhtml#ab4c4a14b880b4247257672358ad7ccfc)(gltf, numIndices, packedIndex, buffer);

 

 // PRIMITIVE

 GLTFWriter::Primitive *primitive = [GLTFWriter::Primitive::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a11dce37f59247e26bd6973ba5d7fefeb)(gltf, [GLTFWriter::Primitive::PT\_TRIANGLES](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea85ba263ad510a4b423c5e1452fd5ca7d), material, index);

 if (!primitive ||

 !mesh-&gt;AppendPrimitive(primitive) ||

 !primitive-&gt;AppendAttribute(vertex) ||

 !primitive-&gt;AppendAttribute(texture)) {

 [GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)(repack);

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Can't create primitive");

 }

 }

 

 [GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)(repack);

 }

 }

 

 if (!gltf-&gt;Write()) {

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 throw std::runtime_error("Error creating file");

 }

 

 <a id="a32" name="a32"></a>[GLTFWriter::GLTF::GLTFError](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#acf83a4d185d959503cb9f3f2c2e9fafe) error = gltf-&gt;GetError();

 

 [GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)(gltf);

 

 if (error != <a id="a33" name="a33"></a>[GLTFWriter::GLTF::GLTF\_ERROR\_NONE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#acf83a4d185d959503cb9f3f2c2e9fafea049c3b804e69ae05c02f4c2dedf4e0ea))

 throw std::runtime_error("Error creating file");

}

[ANSYS::Nexus::GLTFWriter::Attribute::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a74b97d3bfc2585fe4d67a663a79abfa1)

static Attribute * Create(GLTF *gltf, const char *name, AttributeType type, unsigned int count, const int *data, Buffer *buffer=0)



[ANSYS::Nexus::GLTFWriter::Attribute::AT\_FLOAT\_VEC3](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba0e6049e71b78dccf0f7f9791abe541c3)

@ AT_FLOAT_VEC3

3 AT_FLOATs

**Definition:** [GLTFAttribute.h:44](_g_l_t_f_attribute_8h_source.xhtml#l00044)



[ANSYS::Nexus::GLTFWriter::Attribute::AT\_FLOAT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba6d124c894e5bdc043eeebec0f852e857)

@ AT_FLOAT

4 byte float

**Definition:** [GLTFAttribute.h:42](_g_l_t_f_attribute_8h_source.xhtml#l00042)



[ANSYS::Nexus::GLTFWriter::Buffer::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_buffer.xhtml#ab3810e93f82a461a858df95e572b221d)

static Buffer * Create(GLTF *gltf)



[ANSYS::Nexus::GLTFWriter::Camera::CreateOrthographic](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_camera.xhtml#acab0b8344a7bb8b65c9690d221705377)

static Camera * CreateOrthographic(GLTF *gltf, const char *name=0, float xmag=1, float ymag=1, float zfar=1000, float znear=-1000)



[ANSYS::Nexus::GLTFWriter::GLTF::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a586171eb8e873e909db02a7eb4d80f5c)

static void Destroy(GLTF *gltf)



[ANSYS::Nexus::GLTFWriter::GLTF::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#ab7ba6d114c76cb60baf41aa6f13e9494)

static GLTF * Create(const char *application, const char *applicationVersion, const char *filePath, OutputType fileType=OT_AVZ)



[ANSYS::Nexus::GLTFWriter::GLTF::GLTFError](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#acf83a4d185d959503cb9f3f2c2e9fafe)

GLTFError

**Definition:** [GLTFGLTF.h:35](_g_l_t_f_g_l_t_f_8h_source.xhtml#l00035)



[ANSYS::Nexus::GLTFWriter::GLTF::GLTF\_ERROR\_NONE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#acf83a4d185d959503cb9f3f2c2e9fafea049c3b804e69ae05c02f4c2dedf4e0ea)

@ GLTF_ERROR_NONE

No Error.

**Definition:** [GLTFGLTF.h:36](_g_l_t_f_g_l_t_f_8h_source.xhtml#l00036)



[ANSYS::Nexus::GLTFWriter::Index::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_index.xhtml#ab4c4a14b880b4247257672358ad7ccfc)

static Index * Create(GLTF *gltf, unsigned int count, const unsigned short *indices, Buffer *buffer=0)



[ANSYS::Nexus::GLTFWriter::Legend::LO\_VERTICAL](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a339aacb19b79675bd3bc9a903349d933ae89817b11c6c1230e3a9b56d04d402fa)

@ LO_VERTICAL

Top to bottom.

**Definition:** [GLTFLegend.h:32](_g_l_t_f_legend_8h_source.xhtml#l00032)



[ANSYS::Nexus::GLTFWriter::Legend::LO\_HORIZONTAL](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a339aacb19b79675bd3bc9a903349d933aff8809926fbf87a325921ca8ab072a48)

@ LO_HORIZONTAL

Left to right.

**Definition:** [GLTFLegend.h:33](_g_l_t_f_legend_8h_source.xhtml#l00034)



[ANSYS::Nexus::GLTFWriter::Legend::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a4538d9a6db05a532b33fccad579ec90e)

static Legend * Create(GLTF *gltf, LegendOrientation orientation, float size, Texture *texture, float mn, float mx, LegendAttachment attachment=LA_XLEFT_YCENTER, const char *title=0, const char *units=0, const char *other=0, unsigned int numTicks=0, const float *valueLocations=0, bool border=false, bool logarithmic=false, float x=0, float y=0, float foregroundR=0, float foregroundG=0, float foregroundB=0, float backgroundR=1, float backgroundG=1, float backgroundB=1, float backgroundA=0)



[ANSYS::Nexus::GLTFWriter::Legend::LA\_XCENTER\_YBOTTOM](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a96892dc857e05a292528ddc6c29a6ea2a1c6ecc55be42d96e2a0526d71fd51c9b)

@ LA_XCENTER_YBOTTOM

Attach to bottom and position at horizontal center.

**Definition:** [GLTFLegend.h:51](_g_l_t_f_legend_8h_source.xhtml#l00051)



[ANSYS::Nexus::GLTFWriter::Legend::LA\_XCENTER\_YTOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a96892dc857e05a292528ddc6c29a6ea2a546848f232c0cb79a70516945e7f367e)

@ LA_XCENTER_YTOP

Attach to top and position at horizontal center.

**Definition:** [GLTFLegend.h:52](_g_l_t_f_legend_8h_source.xhtml#l00052)



[ANSYS::Nexus::GLTFWriter::Legend::LA\_XRIGHT\_YCENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a96892dc857e05a292528ddc6c29a6ea2a74c6997c4d92c6b6c95e67dbe827fe32)

@ LA_XRIGHT_YCENTER

Attach to right and position at vertical center.

**Definition:** [GLTFLegend.h:49](_g_l_t_f_legend_8h_source.xhtml#l00049)



[ANSYS::Nexus::GLTFWriter::Legend::LA\_X\_YCENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_legend.xhtml#a96892dc857e05a292528ddc6c29a6ea2a78c88258f5d9a3a003e6bb1d49446c3b)

@ LA_X_YCENTER

Use x location and position at vertical center.

**Definition:** [GLTFLegend.h:41](_g_l_t_f_legend_8h_source.xhtml#l00041)



[ANSYS::Nexus::GLTFWriter::Material::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_material.xhtml#a683cf8ee4a674e8e7a7b01c97797eecc)

static Material * Create(GLTF *gltf, Technique *technique)



[ANSYS::Nexus::GLTFWriter::Mesh::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_mesh.xhtml#a9f7803b1b1eb72e4005665ca33f42788)

static Mesh * Create(GLTF *gltf)



[ANSYS::Nexus::GLTFWriter::Node::CreateMesh](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a4dd14791b2b9e65c115aa7a9e3f340e8)

static Node * CreateMesh(GLTF *gltf, const char *name=0, bool visible=true, const double *matrix=0)



[ANSYS::Nexus::GLTFWriter::Node::CreateLegend](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a978541706f278234a1267f0bd2010ab7)

static Node * CreateLegend(GLTF *gltf, Legend *legend, const char *name=0, bool visible=true)



[ANSYS::Nexus::GLTFWriter::Node::CreateCamera](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#af6c4767cc8271d9d39816d278538197a)

static Node * CreateCamera(GLTF *gltf, Camera *camera, const char *name=0, const double *matrix=0)



[ANSYS::Nexus::GLTFWriter::Primitive::PT\_TRIANGLES](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea85ba263ad510a4b423c5e1452fd5ca7d)

@ PT_TRIANGLES

Treats each triplet of vertices as an independent triangle.

**Definition:** [GLTFMesh.h:39](_g_l_t_f_mesh_8h_source.xhtml#l00039)



[ANSYS::Nexus::GLTFWriter::Primitive::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a11dce37f59247e26bd6973ba5d7fefeb)

static Primitive * Create(GLTF *gltf, PrimitiveType type, Material *material, Index *indices=0, bool isPickable=true)



[ANSYS::Nexus::GLTFWriter::Scene::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_scene.xhtml#aac8bcb85d4361abba99053b3c56eb08b)

static Scene * Create(GLTF *gltf, const char *name=0, const char *units=0, float scale=1, Scene::BackgroundType backgroundType=Scene::BT_NONE, float r1=0, float g1=0, float b1=0, float r2=0, float g2=0, float b2=0)



[ANSYS::Nexus::GLTFWriter::Scene::BT\_TB](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_scene.xhtml#ac17baf491cdba3613b0aa39719a3dbd8a0e9df8d9774401657f9d7aad4e18728f)

@ BT_TB

Make gradient from color 1 top to color 2 bottom.

**Definition:** [GLTFScene.h:36](_g_l_t_f_scene_8h_source.xhtml#l00036)



[ANSYS::Nexus::GLTFWriter::State::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#a8cefd28a7477d1ab51809a51b21b8019)

static State * Create(GLTF *gltf, StateType type, double v1, double v2=0, double v3=0, double v4=0)



[ANSYS::Nexus::GLTFWriter::State::ST\_DEPTHTESTENABLE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#affd67e37265c1883f760fd0c368ba718a5a304a50ef0c9a98124f4c998ec47f3b)

@ ST_DEPTHTESTENABLE

Enables testing of depth buffer. Possible values are:

**Definition:** [GLTFTechnique.h:186](_g_l_t_f_technique_8h_source.xhtml#l00186)



[ANSYS::Nexus::GLTFWriter::Technique::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_technique.xhtml#a13382537cb3622195e7cf0bf33e202c2)

static Technique * Create(GLTF *gltf, Program *program=0, bool is2D=false)



[ANSYS::Nexus::GLTFWriter::Texture::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#a3d15e0e6ad83cd7d50bb81ce2d0f30c8)

static Texture * Create(GLTF *gltf, TextureFormat format, TextureTarget target, Sampler *sampler, Image *image)



[ANSYS::Nexus::GLTFWriter::Texture::TF\_RGB](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964aaa8ea9a0e6b83932a6a882b1655e8e59)

@ TF_RGB

3 unsigned chars per pixel.

**Definition:** [GLTFTexture.h:34](_g_l_t_f_texture_8h_source.xhtml#l00034)



[ANSYS::Nexus::GLTFWriter::Utils::Repack::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#a81856527dc12542540dce2f517b5eec4)

static Repack * Create(unsigned int elementCount, unsigned int elementSize, const unsigned int *indices)



[ANSYS::Nexus::GLTFWriter::Utils::Repack::Destroy](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils_1_1_repack.xhtml#ae380a98f35dd3c7dc8cd3cb87e56e9df)

static void Destroy(Repack *packer)



[ANSYS::Nexus::GLTFWriter::Value::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_value.xhtml#aee78dae95614f843f10d5e19f9d55d61)

static Value * Create(GLTF *gltf, const char *name, const Value *value=0)