Returns the minimum Z coordinate of a mesh's bounding box in local mesh space.
Takes entity (mesh entity handle).
Returns minimum Z value, or 0.0 on error.
3D Graphics
Parameters & Returns
Parameters
entityInt
Returns
Double
Quick Summary
Returns the minimum Z coordinate of a mesh's bounding box in local mesh space.
Takes entity (mesh entity handle).
Returns minimum Z value, or 0.0 on error.
Technical Exegesis...
Returns the minimum Z coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns minimum Z value (Double), or 0.0 on error. Validates entity exists and type is ENTITY_MESH. Validates mesh has vertex data (not empty). Iterates all vertices in mesh to find minimum Z position. Returns unscaled mesh-space coordinate (does not account for entity scale/rotation). Silently returns 0.0 on errors.
Returns the minimum Z coordinate of a mesh's bounding box in local mesh space. Takes entity (mesh entity handle). Returns minimum Z value (Double), or 0.0 on error. Validates entity exists and type is ENTITY_MESH. Validates mesh has vertex data (not empty). Iterates all vertices in mesh to find minimum Z position. Returns unscaled mesh-space coordinate (does not account for entity scale/rotation). Silently returns 0.0 on errors.
This function queries mesh bounding box extent for collision detection, depth culling, or procedural placement. Returns local-space coordinates before transforms applied - multiply by entity scale to get world-space extent. Useful for: (1) Calculating bounding boxes (get MinX/MaxX/MinY/MaxY/MinZ/MaxZ for full bounds), (2) Depth alignment (align front edge to position: entityZ = targetZ - b3dMeshMinZ), (3) Procedural placement (stack objects depth-wise: nextZ = prevZ + b3dMeshMaxZ(prev) - b3dMeshMinZ(next)), (4) Collision volume sizing (depth = MaxZ - MinZ). Coordinate system: right-handed, Z-axis points forward/into screen. For scaled bounds, multiply by b3dEntityScaleZ (global scale). For rotated bounds, transformation required (not axis-aligned). Complements b3dMeshDepth (depth = MaxZ - MinZ), b3dMeshWidth, b3dMeshHeight. Use b3dFitMesh to scale mesh to fit target dimensions. Returns actual vertex position min - for primitives like sphere/cube, typically -radius or -size/2. For loaded meshes, depends on modeling coordinates. Common values: cube (-1.0), sphere (-1.0), custom meshes (arbitrary). Performance: O(n) iteration over vertices - cache result if querying repeatedly. Does not trigger GPU operations.
Example
Example.bam
; Get mesh depthLocal mesh:Int = b3dCreateTorus(1, 0, 0, 16, 8, 1.5, 0.4)
Local minZ:Double = b3dMeshMinZ(mesh)
Local maxZ:Double = b3dMeshMaxZ(mesh)
Local depth:Double = maxZ - minZ
Print("Mesh depth: " + ToString(depth))