Test001
Last update: 16.07.2025Lighted textured box.
This example creates a simple box object that is colored by a randomized texture coordinate that ranges from -5 to +5. The texture coordinate is applied to TEXCOORD0 so that the ANSYSViewer can show the texture coordinate value in the tooltip. This simulates coloring a mesh by a variable value.
Two lights are added to the scene to provide feature enhancement as the scene is transformed in the ANSYS Viewer.
An orthographic camera is added to the scene with a default identity transformation. Because of this identity transformation, the simple box is not initially positioned in the most optimal location in the scene.
The shaders for this example are automatically generated by the GLTFWriter API.
<script src="./ansys251/nexus/viewer-loader.js"></script>