Returns vertex Y position coordinate (negated to match Y+ = up convention).
Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based).
Returns Y coordinate as double or 0.
3D Graphics
Parameters & Returns
Parameters
meshInt
surfaceInt
vertexIndexInt
Returns
Double
Quick Summary
Returns vertex Y position coordinate (negated to match Y+ = up convention).
Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based).
Returns Y coordinate as double or 0.
Technical Exegesis...
Returns vertex Y position coordinate (negated to match Y+ = up convention). Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based). Returns Y 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.y (negated). Returns 0.0 if: invalid mesh, not surface-based, invalid surface, vertex index out of range.
Returns vertex Y position coordinate (negated to match Y+ = up convention). Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based). Returns Y 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.y (negated). Returns 0.0 if: invalid mesh, not surface-based, invalid surface, vertex index out of range.
This function retrieves vertex position Y component with coordinate system conversion. CRITICAL: Y-axis negation applied - DirectX stores Y- = up internally, BambooBasic presents Y+ = up to user. When vertex added via b3dAddVertex(mesh, surf, x, 10.0, z), Y stored as -10.0 internally, b3dVertexY returns +10.0 (double negation = original value). Negation ensures: user sees consistent Y-up coordinate system, internal DirectX rendering works correctly with Y-down convention. Y-axis convention: positive Y = up, negative Y = down (user-facing), internally reversed for DirectX. Return value 0.0 ambiguous (could be vertex at XZ-plane or error) - validate mesh/surface/vertex separately if needed. Use cases: (1) Height queries (find highest/lowest vertex), (2) Ground plane detection (check if vertices touch Y=0), (3) Vertical bounds calculation (find min/max Y for bounding box), (4) Mesh validation (verify vertices in expected Y 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), If y > maxHeight Then maxHeight=y. Symmetry with AddVertex: b3dAddVertex negates Y on input, b3dVertexY negates Y on output - round-trip preserves original value. Alternative: b3dVertexCoords for batch modification, b3dEntityY for entity world Y position. Precision: double precision (64-bit float). Typical values: terrain heights 0.0 to 100.0, character models -2.0 to +2.0 (if 2 units tall), sky dome vertices 500.0+. Coordinate consistency: always use b3dVertexY for queries (don't read internal position.y directly) to maintain Y-up abstraction.