    

 ## On this page

  

 

 # Test010

 Last update: 16.07.2025 

Different types of primitives.

This example demonstrates the different types of primitives that are available. At the moment WebGL is limited to primitives no larger than triangles (3 vertices per primitive).

Most applications generally stick to POINTS, LINES, or TRIANGLES. &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;

 

\#include "GLTFWriter.h"

\#include "test.h"

 

using namespace ANSYS::Nexus;

 

namespace {

 void PositionAppend(std::vector&lt;float&gt; &amp;dest,

 const std::vector&lt;float&gt; &amp;src,

 unsigned int srcOffset,

 unsigned int srcCount,

 float offsetX,

 float offsetY,

 float offsetZ)

 {

 unsigned int destOffset = (unsigned int)dest.size();

 dest.resize(destOffset + 3 * srcCount);

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

 dest[destOffset + 3 * i + 0] = src[3 * (srcOffset + i) + 0] + offsetX;

 dest[destOffset + 3 * i + 1] = src[3 * (srcOffset + i) + 1] + offsetY;

 dest[destOffset + 3 * i + 2] = src[3 * (srcOffset + i) + 2] + offsetZ;

 }

 }

};

 

// primitiveTypes

TESTFUNC(PrimitiveTypes)

{

 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

 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, "TestScene", "m", 1.0F, <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);

 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");

 }

 

 // LIGHTS

 {

 // LIGHT NODE

 GLTFWriter::Node *lightNode = <a id="a4" name="a4"></a>[GLTFWriter::Node::CreateLight](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a7883624afdcaae45b6018944a040a01c)(gltf);

 if (!lightNode || !scene-&gt;SetLight(lightNode)) {

 [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 light");

 }

 

 // LIGHTS

 GLTFWriter::Light *light1 = <a id="a5" name="a5"></a>[GLTFWriter::Light::CreateAmbient](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_light.xhtml#a14a825d32570498d64b6a427fb4f8207)(gltf);

 lightNode-&gt;AppendLight(light1);

 

 GLTFWriter::Light *light2 = <a id="a6" name="a6"></a>[GLTFWriter::Light::CreateDirectional](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_light.xhtml#aa54e23609ac5f7a1a6808b62ee48163d)(gltf, 1, 1, 1, -1, -1, -3);

 lightNode-&gt;AppendLight(light2);

 }

 

 float x = 0;

 float y = 0;

 float z = 0;

 

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

 locations.push_back(x + 0.0F); locations.push_back(y + 0.0F); locations.push_back(z - 0.0F);

 locations.push_back(x + 1.0F); locations.push_back(y + 0.0F); locations.push_back(z - 0.0F);

 locations.push_back(x + 1.0F); locations.push_back(y + 1.0F); locations.push_back(z - 0.0F);

 locations.push_back(x + 0.0F); locations.push_back(y + 1.0F); locations.push_back(z - 0.0F);

 locations.push_back(x + 0.0F); locations.push_back(y + 0.0F); locations.push_back(z - 1.0F);

 locations.push_back(x + 1.0F); locations.push_back(y + 0.0F); locations.push_back(z - 1.0F);

 locations.push_back(x + 1.0F); locations.push_back(y + 1.0F); locations.push_back(z - 1.0F);

 locations.push_back(x + 0.0F); locations.push_back(y + 1.0F); locations.push_back(z - 1.0F);

 

 // POINTS

 {

 // NODE

 GLTFWriter::Node *node = <a id="a7" name="a7"></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, "Points");

 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");

 }

 

 // MESH

 GLTFWriter::Mesh *mesh = <a id="a8" name="a8"></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 || !node-&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="a9" name="a9"></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-&gt;AppendState(<a id="a10" name="a10"></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="a11" name="a11"></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="a12" name="a12"></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="a13" name="a13"></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, "color", 1.0, 0.0, 0.0, 1.0)) || // color name is used to auto-generate a solid colored object

 !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, "pointSize", 50.0))) {

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 8, x, y, z);

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = <a id="a14" name="a14"></a>[GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // PRIMITIVE

 GLTFWriter::Primitive *primitive = <a id="a15" name="a15"></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="a16" name="a16"></a>[GLTFWriter::Primitive::PT\_POINTS](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea0774f687d37a015adb12a7c57f157190), material);

 if (!primitive ||

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

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

 [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");

 }

 }

 

 y += 2;

 

 // INDEXED POINTS

 {

 // 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, "Indexed Points (Does not make sense)");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.5, 0.0, 0.0, 1.0)) || // color name is used to auto-generate a solid colored object

 !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, "pointSize", 50.0))) {

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 8, x, y, z);

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

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // INDICES

 std::vector&lt;unsigned short&gt; indices;

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

 indices.push_back(i);

 

 // INDEX

 GLTFWriter::Index *index = <a id="a17" name="a17"></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, (unsigned int)indices.size(), &amp;indices[0]);

 

 // 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\_POINTS](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea0774f687d37a015adb12a7c57f157190), material, index);

 if (!primitive ||

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

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

 [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");

 }

 }

 

 x += 2;

 y -= 2;

 

 // LINES

 {

 // 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, "Lines");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.0, 1.0, 0.0, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 2, x, y, z);

 PositionAppend(vertices, locations, 1, 2, x, y, z);

 PositionAppend(vertices, locations, 2, 2, x, y, z);

 PositionAppend(vertices, locations, 3, 1, x, y, z); PositionAppend(vertices, locations, 0, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 2, x, y, z);

 PositionAppend(vertices, locations, 5, 2, x, y, z);

 PositionAppend(vertices, locations, 6, 2, x, y, z);

 PositionAppend(vertices, locations, 7, 1, x, y, z); PositionAppend(vertices, locations, 4, 1, x, y, z);

 PositionAppend(vertices, locations, 0, 1, x, y, z); PositionAppend(vertices, locations, 4, 1, x, y, z);

 PositionAppend(vertices, locations, 1, 1, x, y, z); PositionAppend(vertices, locations, 5, 1, x, y, z);

 PositionAppend(vertices, locations, 2, 1, x, y, z); PositionAppend(vertices, locations, 6, 1, x, y, z);

 PositionAppend(vertices, locations, 3, 1, x, y, z); PositionAppend(vertices, locations, 7, 1, x, y, z);

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // 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, <a id="a18" name="a18"></a>[GLTFWriter::Primitive::PT\_LINES](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea58ccc160090e6c9189f73c4644e66c0e), material);

 if (!primitive ||

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

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

 [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");

 }

 }

 

 y += 2;

 

 // INDEXED LINES

 {

 // 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, "Indexed Lines");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.0, 0.5, 0.0, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 8, x, y, z);

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // INDICES

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1);

 indices.push_back(1); indices.push_back(2);

 indices.push_back(2); indices.push_back(3);

 indices.push_back(3); indices.push_back(0);

 indices.push_back(4); indices.push_back(5);

 indices.push_back(5); indices.push_back(6);

 indices.push_back(6); indices.push_back(7);

 indices.push_back(7); indices.push_back(4);

 indices.push_back(0); indices.push_back(4);

 indices.push_back(1); indices.push_back(5);

 indices.push_back(2); indices.push_back(6);

 indices.push_back(3); indices.push_back(7);

 

 // INDEX

 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, (unsigned int)indices.size(), &amp;indices[0]);

 

 // 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\_LINES](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea58ccc160090e6c9189f73c4644e66c0e), material, index);

 if (!primitive ||

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

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

 [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");

 }

 }

 

 x += 2;

 y -= 2;

 

 // LINE LOOP

 {

 // 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, "Line Loop");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.0, 0.0, 1.0, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 3, x, y, z);

 PositionAppend(vertices, locations, 6, 1, x, y, z);

 PositionAppend(vertices, locations, 5, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 1, x, y, z);

 PositionAppend(vertices, locations, 7, 1, x, y, z);

 PositionAppend(vertices, locations, 3, 1, x, y, z);

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // 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, <a id="a19" name="a19"></a>[GLTFWriter::Primitive::PT\_LINE\_LOOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6eaf50567675c73731765f0fc37183b1691), material);

 if (!primitive ||

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

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

 [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");

 }

 }

 

 y += 2;

 

 // INDEXED LINE LOOP

 {

 // 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, "Indexed Line Loop");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.0, 0.0, 0.5, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 8, x, y, z);

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // INDICES

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(2);

 indices.push_back(6);

 indices.push_back(5);

 indices.push_back(4);

 indices.push_back(7);

 indices.push_back(3);

 

 // INDEX

 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, (unsigned int)indices.size(), &amp;indices[0]);

 

 // 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\_LINE\_LOOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6eaf50567675c73731765f0fc37183b1691), material, index);

 if (!primitive ||

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

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

 [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");

 }

 }

 

 x += 2;

 y -= 2;

 

 // LINE STRIP

 {

 // 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, "Line Strip");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.75, 0.75, 0.0, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 4, x, y, z);

 PositionAppend(vertices, locations, 0, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 4, x, y, z);

 PositionAppend(vertices, locations, 4, 1, x, y, z);

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // 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\_LINE\_LOOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6eaf50567675c73731765f0fc37183b1691), material);

 if (!primitive ||

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

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

 [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");

 }

 }

 

 y += 2;

 

 // INDEXED LINE STRIP

 {

 // 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, "Indexed Line Strip");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.25, 0.25, 0.0, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 8, x, y, z);

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // INDICES

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(2); indices.push_back(3);

 indices.push_back(0);

 indices.push_back(4); indices.push_back(5); indices.push_back(6); indices.push_back(7);

 indices.push_back(4);

 

 // INDEX

 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, (unsigned int)indices.size(), &amp;indices[0]);

 

 // 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\_LINE\_LOOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6eaf50567675c73731765f0fc37183b1691), material, index);

 if (!primitive ||

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

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

 [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");

 }

 }

 

 x += 2;

 y -= 2;

 

 // TRIANGLES

 {

 // 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, "Triangles");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.0, 1.0, 1.0, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 3, x, y, z);

 PositionAppend(vertices, locations, 0, 1, x, y, z); PositionAppend(vertices, locations, 2, 2, x, y, z);

 PositionAppend(vertices, locations, 1, 1, x, y, z); PositionAppend(vertices, locations, 5, 2, x, y, z);

 PositionAppend(vertices, locations, 1, 1, x, y, z); PositionAppend(vertices, locations, 6, 1, x, y, z); PositionAppend(vertices, locations, 2, 1, x, y, z);

 PositionAppend(vertices, locations, 5, 1, x, y, z); PositionAppend(vertices, locations, 4, 1, x, y, z); PositionAppend(vertices, locations, 7, 1, x, y, z);

 PositionAppend(vertices, locations, 5, 1, x, y, z); PositionAppend(vertices, locations, 7, 1, x, y, z); PositionAppend(vertices, locations, 6, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 1, x, y, z); PositionAppend(vertices, locations, 0, 1, x, y, z); PositionAppend(vertices, locations, 3, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 1, x, y, z); PositionAppend(vertices, locations, 3, 1, x, y, z); PositionAppend(vertices, locations, 7, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 2, x, y, z); PositionAppend(vertices, locations, 1, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 1, x, y, z); PositionAppend(vertices, locations, 1, 1, x, y, z); PositionAppend(vertices, locations, 0, 1, x, y, z);

 PositionAppend(vertices, locations, 3, 1, x, y, z); PositionAppend(vertices, locations, 2, 1, x, y, z); PositionAppend(vertices, locations, 6, 1, x, y, z);

 PositionAppend(vertices, locations, 3, 1, x, y, z); PositionAppend(vertices, locations, 6, 2, x, y, z);

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

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // NORMALS

 std::vector&lt;float&gt; vertexNormals(3 * numVertices);

 {

 std::vector&lt;unsigned short&gt; indices;

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

 indices.push_back(i);

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

 <a id="a20" name="a20"></a>[GLTFWriter::Utils::ComputeVertexNormals3](namespace_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils.xhtml#a79e0bdf1db7d56a58b428ee308f66bad)(numVertices, &amp;vertices[0], numTriangles, 3, &amp;indices[0], &amp;vertexNormals[0]);

 }

 

 // NORMAL ATTRIBUTE

 GLTFWriter::Attribute *normal = <a id="a21" name="a21"></a>[GLTFWriter::Attribute::CreateNormal](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa0488c9bf977a5c3b55034b3c39eb9c5)(gltf, numVertices, &amp;vertexNormals[0]);

 

 // 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, <a id="a22" name="a22"></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);

 if (!primitive ||

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

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

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

 [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");

 }

 }

 

 y += 2;

 

 // INDEXED TRIANGLES

 {

 // 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, "Indexed Triangles");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.0, 0.5, 0.5, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 8, x, y, z);

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

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, numVertices, &amp;vertices[0]);

 

 // INDICES

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(2);

 indices.push_back(0); indices.push_back(2); indices.push_back(3);

 indices.push_back(1); indices.push_back(5); indices.push_back(6);

 indices.push_back(1); indices.push_back(6); indices.push_back(2);

 indices.push_back(5); indices.push_back(4); indices.push_back(7);

 indices.push_back(5); indices.push_back(7); indices.push_back(6);

 indices.push_back(4); indices.push_back(0); indices.push_back(3);

 indices.push_back(4); indices.push_back(3); indices.push_back(7);

 indices.push_back(0); indices.push_back(4); indices.push_back(5);

 indices.push_back(0); indices.push_back(5); indices.push_back(1);

 indices.push_back(2); indices.push_back(6); indices.push_back(7);

 indices.push_back(2); indices.push_back(7); indices.push_back(3);

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

 

 // INDEX

 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, (unsigned int)indices.size(), &amp;indices[0]);

 

 // NORMALS

 std::vector&lt;float&gt; vertexNormals(3 * numVertices);

 [GLTFWriter::Utils::ComputeVertexNormals3](namespace_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils.xhtml#a79e0bdf1db7d56a58b428ee308f66bad)(numVertices, &amp;vertices[0], numTriangles, 3, &amp;indices[0], &amp;vertexNormals[0]);

 

 // NORMAL ATTRIBUTE

 GLTFWriter::Attribute *normal = [GLTFWriter::Attribute::CreateNormal](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa0488c9bf977a5c3b55034b3c39eb9c5)(gltf, numVertices, &amp;vertexNormals[0]);

 

 // 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(normal)) {

 [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");

 }

 }

 

 x += 2;

 y -= 2;

 

 // TRIANGLE STRIP

 {

 // 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, "Triangle Strip");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 1.0, 0.0, 1.0, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 2, x, y, z); PositionAppend(vertices, locations, 3, 1, x, y, z);

 PositionAppend(vertices, locations, 2, 1, x, y, z);

 PositionAppend(vertices, locations, 7, 1, x, y, z);

 PositionAppend(vertices, locations, 6, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 1, x, y, z);

 PositionAppend(vertices, locations, 5, 1, x, y, z);

 PositionAppend(vertices, locations, 0, 1, x, y, z);

 PositionAppend(vertices, locations, 1, 1, x, y, z);

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

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // NORMALS

 std::vector&lt;float&gt; vertexNormals(3 * numVertices);

 {

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(2);

 indices.push_back(2); indices.push_back(1); indices.push_back(3);

 indices.push_back(2); indices.push_back(3); indices.push_back(4);

 indices.push_back(4); indices.push_back(3); indices.push_back(5);

 indices.push_back(4); indices.push_back(5); indices.push_back(6);

 indices.push_back(6); indices.push_back(5); indices.push_back(7);

 indices.push_back(6); indices.push_back(7); indices.push_back(8);

 indices.push_back(8); indices.push_back(7); indices.push_back(9);

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

 [GLTFWriter::Utils::ComputeVertexNormals3](namespace_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils.xhtml#a79e0bdf1db7d56a58b428ee308f66bad)(numVertices, &amp;vertices[0], numTriangles, 3, &amp;indices[0], &amp;vertexNormals[0]);

 }

 

 // NORMAL ATTRIBUTE

 GLTFWriter::Attribute *normal = [GLTFWriter::Attribute::CreateNormal](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa0488c9bf977a5c3b55034b3c39eb9c5)(gltf, numVertices, &amp;vertexNormals[0]);

 

 // 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, <a id="a23" name="a23"></a>[GLTFWriter::Primitive::PT\_TRIANGLE\_STRIP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6eafc347f454c2be56abecc316154511956), material);

 if (!primitive ||

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

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

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

 [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");

 }

 }

 

 y += 2;

 

 // INDEXED TRIANGLE STRIP

 {

 // 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, "Indexed Triangle Strip");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.5, 0.0, 0.5, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 8, x, y, z);

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

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, numVertices, &amp;vertices[0]);

 

 // INDICES

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(3);

 indices.push_back(2);

 indices.push_back(7);

 indices.push_back(6);

 indices.push_back(4);

 indices.push_back(5);

 indices.push_back(0);

 indices.push_back(1);

 

 // INDEX

 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, (unsigned int)indices.size(), &amp;indices[0]);

 

 // NORMALS

 std::vector&lt;float&gt; vertexNormals(3 * numVertices);

 {

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(3);

 indices.push_back(3); indices.push_back(1); indices.push_back(2);

 indices.push_back(3); indices.push_back(2); indices.push_back(7);

 indices.push_back(7); indices.push_back(2); indices.push_back(6);

 indices.push_back(7); indices.push_back(6); indices.push_back(4);

 indices.push_back(4); indices.push_back(6); indices.push_back(5);

 indices.push_back(4); indices.push_back(5); indices.push_back(0);

 indices.push_back(0); indices.push_back(5); indices.push_back(1);

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

 [GLTFWriter::Utils::ComputeVertexNormals3](namespace_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils.xhtml#a79e0bdf1db7d56a58b428ee308f66bad)(numVertices, &amp;vertices[0], numTriangles, 3, &amp;indices[0], &amp;vertexNormals[0]);

 }

 

 // NORMAL ATTRIBUTE

 GLTFWriter::Attribute *normal = [GLTFWriter::Attribute::CreateNormal](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa0488c9bf977a5c3b55034b3c39eb9c5)(gltf, numVertices, &amp;vertexNormals[0]);

 

 // 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\_TRIANGLE\_STRIP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6eafc347f454c2be56abecc316154511956), material, index);

 if (!primitive ||

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

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

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

 [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");

 }

 }

 

 x += 2;

 y -= 2;

 

 // TRIANGLE FAN

 {

 // 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, "Triangle Fan");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.75, 0.0, 0.75, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 4, x, y, z);

 PositionAppend(vertices, locations, 7, 1, x, y, z);

 PositionAppend(vertices, locations, 4, 2, x, y, z);

 PositionAppend(vertices, locations, 1, 1, x, y, z);

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

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, (unsigned int)vertices.size() / 3, &amp;vertices[0]);

 

 // NORMALS

 std::vector&lt;float&gt; vertexNormals(3 * numVertices);

 {

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(2);

 indices.push_back(0); indices.push_back(2); indices.push_back(3);

 indices.push_back(0); indices.push_back(3); indices.push_back(4);

 indices.push_back(0); indices.push_back(4); indices.push_back(5);

 indices.push_back(0); indices.push_back(5); indices.push_back(6);

 indices.push_back(0); indices.push_back(6); indices.push_back(7);

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

 [GLTFWriter::Utils::ComputeVertexNormals3](namespace_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils.xhtml#a79e0bdf1db7d56a58b428ee308f66bad)(numVertices, &amp;vertices[0], numTriangles, 3, &amp;indices[0], &amp;vertexNormals[0]);

 }

 

 // NORMAL ATTRIBUTE

 GLTFWriter::Attribute *normal = [GLTFWriter::Attribute::CreateNormal](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa0488c9bf977a5c3b55034b3c39eb9c5)(gltf, numVertices, &amp;vertexNormals[0]);

 

 // 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, <a id="a24" name="a24"></a>[GLTFWriter::Primitive::PT\_TRIANGLE\_FAN](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea9188d6dcf0e77ae8346e0211f1996320), material);

 if (!primitive ||

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

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

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

 [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");

 }

 }

 

 y += 2;

 // INDEXED TRIANGLE FAN

 {

 // 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, "Indexed Triangle Fan");

 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");

 }

 

 // 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 || !node-&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-&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, "color", 0.25, 0.0, 0.25, 1.0))) { // color name is used to auto-generate a solid colored object

 [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");

 }

 

 // VERTICES

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

 PositionAppend(vertices, locations, 0, 8, x, y, z);

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

 

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = [GLTFWriter::Attribute::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)(gltf, numVertices, &amp;vertices[0]);

 

 // INDICES

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(2);

 indices.push_back(3); 

 indices.push_back(7); 

 indices.push_back(4); 

 indices.push_back(5); 

 indices.push_back(1); 

 

 // INDEX

 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, (unsigned int)indices.size(), &amp;indices[0]);

 

 // NORMALS

 std::vector&lt;float&gt; vertexNormals(3 * numVertices);

 {

 std::vector&lt;unsigned short&gt; indices;

 indices.push_back(0); indices.push_back(1); indices.push_back(2);

 indices.push_back(0); indices.push_back(2); indices.push_back(3);

 indices.push_back(0); indices.push_back(3); indices.push_back(7);

 indices.push_back(0); indices.push_back(7); indices.push_back(4);

 indices.push_back(0); indices.push_back(4); indices.push_back(5);

 indices.push_back(0); indices.push_back(5); indices.push_back(1);

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

 [GLTFWriter::Utils::ComputeVertexNormals3](namespace_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils.xhtml#a79e0bdf1db7d56a58b428ee308f66bad)(numVertices, &amp;vertices[0], numTriangles, 3, &amp;indices[0], &amp;vertexNormals[0]);

 }

 

 // NORMAL ATTRIBUTE

 GLTFWriter::Attribute *normal = [GLTFWriter::Attribute::CreateNormal](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa0488c9bf977a5c3b55034b3c39eb9c5)(gltf, numVertices, &amp;vertexNormals[0]);

 

 // 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\_TRIANGLE\_FAN](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea9188d6dcf0e77ae8346e0211f1996320), material, index);

 if (!primitive ||

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

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

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

 [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");

 }

 }

 

 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="a25" name="a25"></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="a26" name="a26"></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::CreatePosition](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#a2490057f37890b1dd7debe04ddf1fd6f)

static Attribute * CreatePosition(GLTF *gltf, unsigned int count, const float *data, Buffer *buffer=0)



[ANSYS::Nexus::GLTFWriter::Attribute::CreateNormal](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa0488c9bf977a5c3b55034b3c39eb9c5)

static Attribute * CreateNormal(GLTF *gltf, unsigned int count, const float *data, Buffer *buffer=0)



[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::Light::CreateAmbient](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_light.xhtml#a14a825d32570498d64b6a427fb4f8207)

static Light * CreateAmbient(GLTF *gltf, float colR=0.3, float colG=0.3, float colB=0.3)



[ANSYS::Nexus::GLTFWriter::Light::CreateDirectional](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_light.xhtml#aa54e23609ac5f7a1a6808b62ee48163d)

static Light * CreateDirectional(GLTF *gltf, float colR=1, float colG=1, float colB=1, float dirX=0, float dirY=0, float dirZ=-1, float specColR=1, float specColG=1, float specColB=1, float shininess=100)



[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::CreateLight](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml#a7883624afdcaae45b6018944a040a01c)

static Node * CreateLight(GLTF *gltf)



[ANSYS::Nexus::GLTFWriter::Primitive::PT\_POINTS](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea0774f687d37a015adb12a7c57f157190)

@ PT_POINTS

Treats each vertex as a single point.

**Definition:** [GLTFMesh.h:35](_g_l_t_f_mesh_8h_source.xhtml#l00035)



[ANSYS::Nexus::GLTFWriter::Primitive::PT\_LINES](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea58ccc160090e6c9189f73c4644e66c0e)

@ PT_LINES

Treats each pair of vertices as an independent line segment.

**Definition:** [GLTFMesh.h:36](_g_l_t_f_mesh_8h_source.xhtml#l00036)



[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::PT\_TRIANGLE\_FAN](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6ea9188d6dcf0e77ae8346e0211f1996320)

@ PT_TRIANGLE_FAN

Draws a connected group of triangles. One triangle is defined for each vertex presented after the fir...

**Definition:** [GLTFMesh.h:41](_g_l_t_f_mesh_8h_source.xhtml#l00042)



[ANSYS::Nexus::GLTFWriter::Primitive::PT\_LINE\_LOOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6eaf50567675c73731765f0fc37183b1691)

@ PT_LINE_LOOP

Draws a connected group of line segments from the first vertex to the last, then back to the first.

**Definition:** [GLTFMesh.h:37](_g_l_t_f_mesh_8h_source.xhtml#l00037)



[ANSYS::Nexus::GLTFWriter::Primitive::PT\_TRIANGLE\_STRIP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a062b429c87d913e5adda11b381414c6eafc347f454c2be56abecc316154511956)

@ PT_TRIANGLE_STRIP

Draws a connected group of triangles. One triangle is defined for each vertex presented after the fir...

**Definition:** [GLTFMesh.h:40](_g_l_t_f_mesh_8h_source.xhtml#l00040)



[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::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)



[ANSYS::Nexus::GLTFWriter::Utils::ComputeVertexNormals3](namespace_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_utils.xhtml#a79e0bdf1db7d56a58b428ee308f66bad)

void ComputeVertexNormals3(const unsigned int numVertices, const float *vertices, const unsigned int numElements, const unsigned int elementSize, const unsigned short *indices, float *normals)