Returns vertex U texture coordinate (horizontal texture mapping).
Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based), coordSet (UV set index, currently ignored - always returns base UV set 0).
Returns U coordinate as double or 0.
3D Graphics
Parameters & Returns
Parameters
meshInt
surfaceInt
vertexIndexInt
coordSetInt
Returns
Double
Quick Summary
Returns vertex U texture coordinate (horizontal texture mapping).
Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based), coordSet (UV set index, currently ignored - always returns base UV set 0).
Returns U coordinate as double or 0.
Technical Exegesis...
Returns vertex U texture coordinate (horizontal texture mapping). Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based), coordSet (UV set index, currently ignored - always returns base UV set 0). Returns U coordinate as double or 0.0 on error. Validates mesh exists, type is ENTITY_MESH, is surface-based, surface index valid, and vertex index valid. Returns surface->vertices[vertexIndex].texCoord.x directly.
Returns vertex U texture coordinate (horizontal texture mapping). Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based), coordSet (UV set index, currently ignored - always returns base UV set 0). Returns U coordinate as double or 0.0 on error. Validates mesh exists, type is ENTITY_MESH, is surface-based, surface index valid, and vertex index valid. Returns surface->vertices[vertexIndex].texCoord.x directly. coordSet parameter ignored (only one UV set currently supported). Returns 0.0 if: invalid mesh, not surface-based, invalid surface, vertex index out of range.
This function retrieves vertex texture U coordinate for texture mapping queries. UV coordinates map 2D texture onto 3D mesh surface. U = horizontal texture axis (left-right), V = vertical texture axis (up-down). U coordinate convention: 0.0 = left edge of texture, 1.0 = right edge, 0.5 = center. Values outside 0-1 range valid: causes texture tiling/wrapping based on sampler settings (repeat, clamp, mirror). Return value 0.0 ambiguous (could be left edge mapping or error) - validate separately. Use cases: (1) Texture coordinate queries (verify UV mapping correct), (2) Procedural UV modification (read, modify, write back with b3dVertexTexCoords), (3) UV bounds calculation (find min/max U for atlas region), (4) Texture animation (offset U coordinates each frame), (5) UV unwrap validation (check for overlapping UVs). Common pattern: For i=0 To b3dCountVertices(mesh, surf)-1, u=b3dVertexU(mesh, surf, i, 0), v=b3dVertexV(mesh, surf, i, 0), If u < 0.0 Or u > 1.0 Then Print "Vertex " + i + " UV out of 0-1 range". coordSet parameter: reserved for multi-UV support (normal maps, lightmaps use separate UV sets), currently only coordSet=0 supported, other values ignored (returns base UV). UV storage: texCoord stored as 2D vector (U, V) in vertex structure. UV origin: (0,0) = top-left corner by convention (OpenGL/DirectX standard). Typical UV values: 0.0 to 1.0 for single texture coverage, 0.0 to N for tiled textures (N repeats), negative values for reverse tiling. UV setting: set via b3dAddVertex(mesh, surf, x,y,z, u,v) or b3dVertexTexCoords. UV generation: procedural via b3dUVMapPlanar/Box/Cylindrical/Spherical or manual assignment. Alternative: batch UV read for entire mesh, use UV mapping algorithms. Precision: double precision (64-bit float) for accurate texture coordinates. Performance: fast direct array access. Texture sampling: GPU interpolates U/V across triangle, samples texture at interpolated coordinate.