    

 ## On this page

  

 

 # Test005

 Last update: 16.07.2025 

Textured 2D Quad.

This example shows how to create a simple 2D textured quad. &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 "GLTFWriter.h"

\#include "test.h"

 

using namespace ANSYS::Nexus;

 

// Simple creation of Textured Quad

TESTFUNC(Textured2DQuad)

{

 if (type != <a id="a0" name="a0"></a>[GLTFWriter::GLTF::OT\_AVZ](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a65f7ca2b0855b66b6ae9f93bd3c1987caffc12fe8ec514248496a1469f781c9e1) &amp;&amp; type != <a id="a1" name="a1"></a>[GLTFWriter::GLTF::OT\_GLTF](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a65f7ca2b0855b66b6ae9f93bd3c1987ca35927e6892acc7aebd8ed3637a26a990))

 return;

 

 GLTFWriter::GLTF *gltf = <a id="a2" name="a2"></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="a3" name="a3"></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.0, <a id="a4" name="a4"></a>[GLTFWriter::Scene::BT\_SOLID](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_scene.xhtml#ac17baf491cdba3613b0aa39719a3dbd8aeea551002921bb989b3ed35678ec982b), 0.5, 0.5, 0.5);

 if (!scene) {

 <a id="a5" name="a5"></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="a6" name="a6"></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="a7" name="a7"></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="a8" name="a8"></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);

 lightNode-&gt;AppendLight(light2);

 }

 

 // 3D MESH NODE

 {

 // NODE

 GLTFWriter::Node *node = <a id="a9" name="a9"></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, "3D Box");

 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="a10" name="a10"></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="a11" name="a11"></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="a12" name="a12"></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="a13" name="a13"></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)) ||

 !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, <a id="a14" name="a14"></a>[GLTFWriter::State::ST\_BLENDENABLE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#affd67e37265c1883f760fd0c368ba718a333b0ebeb6a896a3b0b973da1f1ce56a), 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="a15" name="a15"></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);

 

 // VERTICES

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

 const float width = 1;

 const float height = 1;

 const float depth = 1;

 const float shiftX = 0;

 const float shiftY = 0;

 const float shiftZ = 0;

 vertices.push_back(-width / 2 + shiftX); vertices.push_back(-height / 2 + shiftY); vertices.push_back(-depth / 2 + shiftZ);

 vertices.push_back( width / 2 + shiftX); vertices.push_back(-height / 2 + shiftY); vertices.push_back(-depth / 2 + shiftZ);

 vertices.push_back( width / 2 + shiftX); vertices.push_back( height / 2 + shiftY); vertices.push_back(-depth / 2 + shiftZ);

 vertices.push_back(-width / 2 + shiftX); vertices.push_back( height / 2 + shiftY); vertices.push_back(-depth / 2 + shiftZ);

 vertices.push_back(-width / 2 + shiftX); vertices.push_back(-height / 2 + shiftY); vertices.push_back( depth / 2 + shiftZ);

 vertices.push_back( width / 2 + shiftX); vertices.push_back(-height / 2 + shiftY); vertices.push_back( depth / 2 + shiftZ);

 vertices.push_back( width / 2 + shiftX); vertices.push_back( height / 2 + shiftY); vertices.push_back( depth / 2 + shiftZ);

 vertices.push_back(-width / 2 + shiftX); vertices.push_back( height / 2 + shiftY); vertices.push_back( depth / 2 + shiftZ);

 // POSITION ATTRIBUTE

 GLTFWriter::Attribute *vertex = <a id="a16" name="a16"></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]);

 

 // COLORS

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

 colors.push_back(0); colors.push_back(0); colors.push_back(0); colors.push_back(1);

 colors.push_back(0); colors.push_back(0); colors.push_back(1); colors.push_back(0.75);

 colors.push_back(0); colors.push_back(1); colors.push_back(0); colors.push_back(0.5);

 colors.push_back(0); colors.push_back(1); colors.push_back(1); colors.push_back(0.25);

 colors.push_back(1); colors.push_back(0); colors.push_back(1); colors.push_back(0.5);

 colors.push_back(1); colors.push_back(0); colors.push_back(0); colors.push_back(0.25);

 colors.push_back(1); colors.push_back(1); colors.push_back(1); colors.push_back(1);

 colors.push_back(1); colors.push_back(1); colors.push_back(0); colors.push_back(0.75);

 // COLOR ATTRIBUTE

 GLTFWriter::Attribute *color = <a id="a17" name="a17"></a>[GLTFWriter::Attribute::CreateColor](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#ac7973400bb8ca2f8d3eb8391b7826cce)(gltf, <a id="a18" name="a18"></a>[GLTFWriter::Attribute::AT\_FLOAT\_VEC4](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba5af14585a5eb16f52089b1baf55db718), (unsigned int)colors.size() / 4, &amp;colors[0]);

 

 // INDICES

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

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

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

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

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

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

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

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

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

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

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

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

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

 // INDICES

 GLTFWriter::Index *index = <a id="a19" name="a19"></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]);

 

 // NORMALS

 std::vector&lt;float&gt; normals(vertices.size());

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

 

 // PRIMITIVE

 GLTFWriter::Primitive *primitive = <a id="a22" name="a22"></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="a23" name="a23"></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(normal) ||

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

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

 }

 }

 

 // 2D MESH NODE

 {

 // 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, "2D Textured Quad");

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

 }

 

 // TEXTURE

 {

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

 const unsigned width = 150;

 const unsigned height = 250;

 imageData.resize(width * height * 4, 0);

 

\# define SETRGB(data, width, x, y, r, g, b, a) { \\

 data\[4 \* ((x) + (y) \* (width)) + 0\] = r; \\

 data\[4 \* ((x) + (y) \* (width)) + 1\] = g; \\

 data\[4 \* ((x) + (y) \* (width)) + 2\] = b; \\

 data\[4 \* ((x) + (y) \* (width)) + 3\] = a; \\

 }

 

 // fill in top left corner

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

 for (unsigned int j = 0; j &lt; 10; ++j)

 SETRGB(imageData, width, i + 2, j + 2, 255, 255, 255, 255);

 

 // PRIMITIVE

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

 SETRGB(imageData, width, i, 0, 255, 0, 0, 255);

 SETRGB(imageData, width, i, 1, 255, 0, 0, 255);

 SETRGB(imageData, width, i, height - 1, 255, 0, 0, 255);

 SETRGB(imageData, width, i, height - 2, 255, 0, 0, 255);

 }

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

 SETRGB(imageData, width, 0, i, 255, 0, 0, 255);

 SETRGB(imageData, width, 1, i, 255, 0, 0, 255);

 SETRGB(imageData, width, width - 1, i, 255, 0, 0, 255);

 SETRGB(imageData, width, width - 2, i, 255, 0, 0, 255);

 }

 GLTFWriter::Texture *texture = <a id="a24" name="a24"></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="a25" name="a25"></a>[GLTFWriter::Texture::TF\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 GLTFWriter::Primitive *primitive = <a id="a26" name="a26"></a>[GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, <a id="a27" name="a27"></a>[GLTFWriter::Primitive::PXA\_LEFT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a6dc9b18bbe43f04ff6744a5111f0a4a3), <a id="a28" name="a28"></a>[GLTFWriter::Primitive::PYA\_TOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa7b6fa012e0f07cb84f0e05345174f93d));

 mesh-&gt;AppendPrimitive(primitive);

 

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

 SETRGB(imageData, width, i, 0, 0, 255, 0, 255);

 SETRGB(imageData, width, i, 1, 0, 255, 0, 255);

 SETRGB(imageData, width, i, height - 1, 0, 255, 0, 255);

 SETRGB(imageData, width, i, height - 2, 0, 255, 0, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, [GLTFWriter::Primitive::PXA\_LEFT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a6dc9b18bbe43f04ff6744a5111f0a4a3), <a id="a29" name="a29"></a>[GLTFWriter::Primitive::PYA\_CENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa55629dea10122996e3ff9915fb6658ba));

 mesh-&gt;AppendPrimitive(primitive);

 

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

 SETRGB(imageData, width, i, 0, 0, 0, 255, 255);

 SETRGB(imageData, width, i, 1, 0, 0, 255, 255);

 SETRGB(imageData, width, i, height - 1, 0, 0, 255, 255);

 SETRGB(imageData, width, i, height - 2, 0, 0, 255, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, [GLTFWriter::Primitive::PXA\_LEFT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a6dc9b18bbe43f04ff6744a5111f0a4a3), <a id="a30" name="a30"></a>[GLTFWriter::Primitive::PYA\_BOTTOM](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa447716243f146a5606c2366e068a997e));

 mesh-&gt;AppendPrimitive(primitive);

 

 

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

 SETRGB(imageData, width, 0, i, 0, 255, 0, 255);

 SETRGB(imageData, width, 1, i, 0, 255, 0, 255);

 SETRGB(imageData, width, width - 1, i, 0, 255, 0, 255);

 SETRGB(imageData, width, width - 2, i, 0, 255, 0, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, <a id="a31" name="a31"></a>[GLTFWriter::Primitive::PXA\_CENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a51f4037d8a135dab3589f9a28e53282a), [GLTFWriter::Primitive::PYA\_BOTTOM](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa447716243f146a5606c2366e068a997e));

 mesh-&gt;AppendPrimitive(primitive);

 

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

 SETRGB(imageData, width, i, 0, 0, 255, 0, 255);

 SETRGB(imageData, width, i, 1, 0, 255, 0, 255);

 SETRGB(imageData, width, i, height - 1, 0, 255, 0, 255);

 SETRGB(imageData, width, i, height - 2, 0, 255, 0, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, [GLTFWriter::Primitive::PXA\_CENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a51f4037d8a135dab3589f9a28e53282a), [GLTFWriter::Primitive::PYA\_CENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa55629dea10122996e3ff9915fb6658ba));

 mesh-&gt;AppendPrimitive(primitive);

 

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

 SETRGB(imageData, width, i, 0, 255, 0, 0, 255);

 SETRGB(imageData, width, i, 1, 255, 0, 0, 255);

 SETRGB(imageData, width, i, height - 1, 255, 0, 0, 255);

 SETRGB(imageData, width, i, height - 2, 255, 0, 0, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, [GLTFWriter::Primitive::PXA\_CENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a51f4037d8a135dab3589f9a28e53282a), [GLTFWriter::Primitive::PYA\_TOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa7b6fa012e0f07cb84f0e05345174f93d));

 mesh-&gt;AppendPrimitive(primitive);

 

 

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

 SETRGB(imageData, width, 0, i, 0, 0, 255, 255);

 SETRGB(imageData, width, 1, i, 0, 0, 255, 255);

 SETRGB(imageData, width, width - 1, i, 0, 0, 255, 255);

 SETRGB(imageData, width, width - 2, i, 0, 0, 255, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, <a id="a32" name="a32"></a>[GLTFWriter::Primitive::PXA\_RIGHT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a2711064b0fe78b1e55fd2741e18bf68d), [GLTFWriter::Primitive::PYA\_TOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa7b6fa012e0f07cb84f0e05345174f93d));

 mesh-&gt;AppendPrimitive(primitive);

 

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

 SETRGB(imageData, width, i, 0, 0, 255, 0, 255);

 SETRGB(imageData, width, i, 1, 0, 255, 0, 255);

 SETRGB(imageData, width, i, height - 1, 0, 255, 0, 255);

 SETRGB(imageData, width, i, height - 2, 0, 255, 0, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, [GLTFWriter::Primitive::PXA\_RIGHT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a2711064b0fe78b1e55fd2741e18bf68d), [GLTFWriter::Primitive::PYA\_CENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa55629dea10122996e3ff9915fb6658ba));

 mesh-&gt;AppendPrimitive(primitive);

 

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

 SETRGB(imageData, width, i, 0, 0, 0, 255, 255);

 SETRGB(imageData, width, i, 1, 0, 0, 255, 255);

 SETRGB(imageData, width, i, height - 1, 0, 0, 255, 255);

 SETRGB(imageData, width, i, height - 2, 0, 0, 255, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, [GLTFWriter::Primitive::PXA\_RIGHT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a2711064b0fe78b1e55fd2741e18bf68d), [GLTFWriter::Primitive::PYA\_BOTTOM](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa447716243f146a5606c2366e068a997e));

 mesh-&gt;AppendPrimitive(primitive);

 

 

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

 SETRGB(imageData, width, i, 0, 255, 255, 255, 255);

 SETRGB(imageData, width, i, 1, 255, 255, 255, 255);

 SETRGB(imageData, width, i, height - 1, 255, 255, 255, 255);

 SETRGB(imageData, width, i, height - 2, 255, 255, 255, 255);

 }

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

 SETRGB(imageData, width, 0, i, 255, 255, 255, 255);

 SETRGB(imageData, width, 1, i, 255, 255, 255, 255);

 SETRGB(imageData, width, width - 1, i, 255, 255, 255, 255);

 SETRGB(imageData, width, width - 2, i, 255, 255, 255, 255);

 }

 texture = [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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af), width, height, &amp;imageData[0]);

 primitive = [GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)(gltf, texture, 0.15F, 0.25F, 0.2F, 0.4F);

 mesh-&gt;AppendPrimitive(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="a33" name="a33"></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="a34" name="a34"></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::Attribute::AT\_FLOAT\_VEC4](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#aa787c451052ac912fd9af91c4ff54ddba5af14585a5eb16f52089b1baf55db718)

@ AT_FLOAT_VEC4

4 AT_FLOATs

**Definition:** [GLTFAttribute.h:45](_g_l_t_f_attribute_8h_source.xhtml#l00045)



[ANSYS::Nexus::GLTFWriter::Attribute::CreateColor](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml#ac7973400bb8ca2f8d3eb8391b7826cce)

static Attribute * CreateColor(GLTF *gltf, AttributeType type, 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::OT\_GLTF](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a65f7ca2b0855b66b6ae9f93bd3c1987ca35927e6892acc7aebd8ed3637a26a990)

@ OT_GLTF

GLTF for ANSYS Viewer.

**Definition:** [GLTFGLTF.h:57](_g_l_t_f_g_l_t_f_8h_source.xhtml#l00057)



[ANSYS::Nexus::GLTFWriter::GLTF::OT\_AVZ](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml#a65f7ca2b0855b66b6ae9f93bd3c1987caffc12fe8ec514248496a1469f781c9e1)

@ OT_AVZ

AVZ file for ANSYS Viewer.

**Definition:** [GLTFGLTF.h:56](_g_l_t_f_g_l_t_f_8h_source.xhtml#l00056)



[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\_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::Primitive::PYA\_BOTTOM](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa447716243f146a5606c2366e068a997e)

@ PYA_BOTTOM

Anchor at bottom edge.

**Definition:** [GLTFMesh.h:55](_g_l_t_f_mesh_8h_source.xhtml#l00055)



[ANSYS::Nexus::GLTFWriter::Primitive::PYA\_CENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa55629dea10122996e3ff9915fb6658ba)

@ PYA_CENTER

Center in vertical direction.

**Definition:** [GLTFMesh.h:56](_g_l_t_f_mesh_8h_source.xhtml#l00056)



[ANSYS::Nexus::GLTFWriter::Primitive::PYA\_TOP](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a1537dd0f96086f101b67ad7f8640cbbaa7b6fa012e0f07cb84f0e05345174f93d)

@ PYA_TOP

Anchor at top edge.

**Definition:** [GLTFMesh.h:57](_g_l_t_f_mesh_8h_source.xhtml#l00058)



[ANSYS::Nexus::GLTFWriter::Primitive::PXA\_RIGHT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a2711064b0fe78b1e55fd2741e18bf68d)

@ PXA_RIGHT

Anchor at right edge.

**Definition:** [GLTFMesh.h:49](_g_l_t_f_mesh_8h_source.xhtml#l00050)



[ANSYS::Nexus::GLTFWriter::Primitive::PXA\_CENTER](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a51f4037d8a135dab3589f9a28e53282a)

@ PXA_CENTER

Center in horizontal direction.

**Definition:** [GLTFMesh.h:48](_g_l_t_f_mesh_8h_source.xhtml#l00048)



[ANSYS::Nexus::GLTFWriter::Primitive::PXA\_LEFT](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a3c17546f3d50b4462d11df6819f93951a6dc9b18bbe43f04ff6744a5111f0a4a3)

@ PXA_LEFT

Anchor at left edge.

**Definition:** [GLTFMesh.h:47](_g_l_t_f_mesh_8h_source.xhtml#l00047)



[ANSYS::Nexus::GLTFWriter::Primitive::Create2DTexture](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_primitive.xhtml#a4c2051e885d8aec753ba97a2ec7f789f)

static Primitive * Create2DTexture(GLTF *gltf, Texture *texture, float width, float height, PrimitiveXAttachment xAttach=PXA_LEFT, PrimitiveYAttachment yAttach=PYA_CENTER)



[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\_SOLID](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_scene.xhtml#ac17baf491cdba3613b0aa39719a3dbd8aeea551002921bb989b3ed35678ec982b)

@ BT_SOLID

Make solid color from color 1.

**Definition:** [GLTFScene.h:35](_g_l_t_f_scene_8h_source.xhtml#l00035)



[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\_BLENDENABLE](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_state.xhtml#affd67e37265c1883f760fd0c368ba718a333b0ebeb6a896a3b0b973da1f1ce56a)

@ ST_BLENDENABLE

Enables blending of fragment colors. Possible values are:

**Definition:** [GLTFTechnique.h:166](_g_l_t_f_technique_8h_source.xhtml#l00166)



[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\_RGBA](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_texture.xhtml#aba6db4f52b9f0a1a866bce302b6d8964ab39a20cf05b8cbdd813d3278664879af)

@ TF_RGBA

4 unsigned chars per pixel.

**Definition:** [GLTFTexture.h:35](_g_l_t_f_texture_8h_source.xhtml#l00038)



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