Returns vertex Z position coordinate.
Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based).
Returns Z coordinate as double or 0.
3D Graphics
Parameters & Returns
Parameters
meshInt
surfaceInt
vertexIndexInt
Returns
Double
Quick Summary
Returns vertex Z position coordinate.
Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based).
Returns Z coordinate as double or 0.
Technical Exegesis...
Returns vertex Z position coordinate. Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based). Returns Z 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].position.z directly. Returns 0.0 if: invalid mesh, not surface-based, invalid surface, vertex index out of range.
Returns vertex Z position coordinate. Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based). Returns Z 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].position.z directly. Returns 0.0 if: invalid mesh, not surface-based, invalid surface, vertex index out of range.
This function retrieves vertex position Z component for depth/distance queries. Position stored as 3D vector (x, y, z) - this function returns Z only. Z-axis convention: positive Z = forward, negative Z = backward (right-handed coordinate system, Z+ points into screen/forward). Return value 0.0 ambiguous (could be vertex at XY-plane or error) - validate mesh/surface/vertex separately if needed. Use cases: (1) Depth sorting (sort vertices by Z for rendering order), (2) Distance calculation (measure Z distance between vertices), (3) Depth bounds (find nearest/farthest Z for culling), (4) Collision detection (check Z-axis overlap), (5) Mesh slicing (select vertices by Z range). Common pattern: For i=0 To b3dCountVertices(mesh, surf)-1, x=b3dVertexX(mesh, surf, i), y=b3dVertexY(mesh, surf, i), z=b3dVertexZ(mesh, surf, i), distance=Sqr(x*x + y*y + z*z). No Z-axis negation: Z coordinate returned as-is (unlike b3dVertexY which negates). Coordinate system: right-handed, Y-up, X+ = right, Y+ = up, Z+ = forward. Precision: double precision (64-bit float) for accurate position values. Vertex position set via b3dAddVertex or b3dVertexCoords - this function only reads. Alternative: batch read all vertex positions, use vector math libraries for position calculations. Performance: fast direct array access. Typical values: model-space coordinates range based on asset size (character mesh -2.0 to +2.0, terrain -500.0 to +500.0, skybox -1000.0 to +1000.0). World Z position: vertex Z in local model space - transform by entity position/rotation for world coordinates. Camera space: different from view space (requires view matrix transformation for camera-relative Z).