glTF Sampler Wrapping: Review Negative Texture Coordinates Without Editing a Drone Model
Compare repeat, mirrored repeat and clamp-to-edge behavior on a constructed negative texture coordinate, keeping wrapping separate from texel filtering and final rendering.

Inspect the sampler before changing texture coordinates
A texture on a drone-derived model can appear repeated, mirrored or stretched at an edge in a review viewer. Before editing the image or moving its texture coordinates, inspect the referenced sampler’s wrapping settings. A negative coordinate does not have a single interpretation across the available modes. This tutorial compares one constructed coordinate under three glTF wrapping modes without loading or modifying a model. It does not reproduce a customer scene or establish a NiVO export feature. The goal is a small, repeatable observation about wrapping that can support a more precise discussion of an apparent texture difference.
Keep the original model package, image references and viewer information together while investigating. The texture, image, sampler and coordinate attribute play different roles. Changing one to improve a screenshot can conceal which relationship caused the display in the first place. Start by identifying the actual references in the supplied asset, then state which coordinate direction is being reviewed. The code below begins after that selection: it receives one scalar coordinate and one explicit mode. It does not find a sampler inside a file, resolve an image URI or determine which texture coordinate set a material uses.
Read repeat, mirrored repeat and edge clamping
Khronos defines repeat as using the fractional part of a texture coordinate. Mirrored repeat reverses direction when the integer interval, determined by rounding down, is odd. Clamp to edge uses the nearest existing edge texel for coordinates outside the image. Wrapping is set independently for S or U and T or V. The integer enums are 10497 for REPEAT, 33648 for MIRRORED_REPEAT and 33071 for CLAMP_TO_EDGE; wrapS and wrapT default to repeat. These rules concern texture addressing. They are separate from the sampler’s magnification and minification filtering choices.
For a negative number, rounding down and truncating toward zero produce different interval labels. That is why the example uses floor rather than int to identify the interval. At minus one quarter, the interval starts at minus one and its fractional position is three quarters. Repeat retains that fractional position; mirrored repeat reverses it to one quarter. Clamp-to-edge requires a different kind of result here: the first edge texel. The exercise names that edge symbolically instead of pretending that a normalized boundary value is the exact center of a selected texel in an image of unknown dimensions.

Product context only; this photograph does not depict the constructed examples in this article.
Run a scalar wrapping inspection offline
This Python helper accepts a finite scalar within a local teaching bound and a supported integer mode. For repeat and mirrored repeat it returns an ideal normalized coordinate. For an out-of-range clamp input it returns an edge label, leaving texel selection and filtering to a real sampler. Inside the base interval it retains the supplied coordinate. This deliberately mixed result type makes the scope visible: the function is an explanatory inspection, not a renderer. The coordinate bound only keeps the example manageable and does not declare a glTF limit, an aircraft capability or a model acceptance rule.
import math
def inspect_wrap_axis(value, mode):
if type(value) not in (int, float) or not math.isfinite(value):
raise ValueError("expected a finite coordinate")
if abs(value) > 1000000:
raise ValueError("outside the local teaching bound")
if type(mode) is not int or mode not in (10497, 33648, 33071):
raise ValueError("unsupported wrapping enum")
if mode == 33071:
if value < 0:
return {"edge": "first"}
if value >= 1:
return {"edge": "last"}
return {"coordinate": float(value)}
interval = math.floor(value)
fraction = value - interval
if mode == 33648 and interval % 2:
fraction = 1 - fraction
return {"coordinate": float(fraction)}
for mode in (10497, 33648, 33071):
print(mode, inspect_wrap_axis(-0.25, mode))Compare negative and positive interval cases
At minus 0.25, the printed results are coordinate 0.75 for repeat, coordinate 0.25 for mirrored repeat and first edge for clamping. Try positive 1.25 next. Repeat gives 0.25, mirrored repeat gives 0.75, and clamping reports the last edge. Those controlled cases show why changing the mode can change addressing without changing the raw coordinate. Preserve the original value in a review note alongside the selected mode. A list containing only the mapped coordinate would lose the information needed to distinguish a repeated interval from a coordinate that originally lay within the base image.
Test integer boundaries as well. Repeat at one returns zero, while the ideal mirrored coordinate at one is one. The clamp branch labels that upper boundary as the last edge. These results describe the wrapping decision; they are not predicted image colors. A renderer still needs the image dimensions, filtering behavior and relevant material inputs. Avoid converting the helper’s coordinate into a pixel index with a casual multiplication and rounding rule. That would introduce an additional sampling model that this tutorial has not defined or tested, especially near edges and under linear or mipmapped filtering.
Keep both directions and filtering explicit
A sampler may repeat horizontally and clamp vertically. Inspect wrapS and wrapT separately rather than applying one convenient mode to both coordinates by assumption. A small review table can retain the original U and V, the selected mode for each and the two inspection results. That table can identify an addressing disagreement without modifying the image or the mesh. If a texture uses additional transformation behavior, consult the relevant extension and the actual asset before applying this scalar exercise to its final coordinates. Unsupported transformations should remain an explicit limit of the comparison.
Wrapping also does not explain every seam or display difference. A coordinate can address the expected region while filtering, image content or another material property affects the result. The helper never reads an image and cannot identify a missing texture, diagnose color handling or compare renderer output. Keep the question narrow enough to reproduce. If the wrapped coordinate matches between two tools, investigate the next stage deliberately instead of repeatedly changing the wrapping mode until a screenshot looks plausible. Preserving the original package makes each observation traceable and keeps a proposed correction separate from the supplied evidence.
Record an addressing finding with its boundaries
A reproducible model review records the asset revision, texture and sampler references, coordinate set, axis, raw scalar and effective wrapping mode. State whether a property was supplied explicitly or obtained from its documented default. Include the helper result as a coordinate or symbolic edge, and mark filtering and final rendering as outside this check. Another reviewer can then repeat the addressing observation without inferring a hidden texel-selection rule. If the asset owner supplies a revised sampler, compare separate revisions against the same constructed boundary cases before interpreting a different view as a resolved delivery issue.
The NiVO product photograph on this page is independent aircraft context. It is not a rendered model or evidence of the constructed texture coordinates. The useful habit is to identify the sampler, preserve the raw coordinate, apply the selected wrapping interpretation and stop before claiming a pixel color. Negative coordinates become understandable when their integer interval and fractional position are explicit. A drone model handoff can then discuss one concrete addressing decision while keeping image validation, material appearance, geometry quality and geospatial acceptance in the separate review steps that those questions require.



