Returns vertex normal Z component (forward/backward surface direction).
Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based).
Returns normal Z as double or 0.
3D Graphics
Parameters & Returns
Parameters
meshInt
surfaceInt
vertexIndexInt
Returns
Double
Quick Summary
Returns vertex normal Z component (forward/backward surface direction).
Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based).
Returns normal Z as double or 0.
Technical Exegesis...
Returns vertex normal Z component (forward/backward surface direction). Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based). Returns normal Z 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].normal.z directly. Returns 0.0 if: invalid mesh, not surface-based, invalid surface, vertex index out of range.
Returns vertex normal Z component (forward/backward surface direction). Takes mesh (surface-based mesh entity), surface (surface handle, 0-based), vertexIndex (vertex number, 0-based). Returns normal Z 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].normal.z directly. Returns 0.0 if: invalid mesh, not surface-based, invalid surface, vertex index out of range.
This function retrieves vertex normal Z component for depth-oriented surface analysis. Normal Z indicates forward/backward orientation of surface. Z component represents normal's forward/backward direction. Normal range: -1.0 to +1.0 (normalized vector component). No Z-axis negation: normal.z returned as-is. Return value 0.0 ambiguous (could be normal parallel to XY-plane or error) - validate separately. Use cases: (1) Front/back face detection (positive NZ = facing forward, negative = backward), (2) Surface orientation for billboards (NZ close to 0 = facing camera sideways), (3) Depth-based lighting (Z-oriented light sources), (4) Normal validation (check magnitude with NX, NY). Common pattern: For i=0 To b3dCountVertices(mesh, surf)-1, nx=b3dVertexNX(mesh, surf, i), ny=b3dVertexNY(mesh, surf, i), nz=b3dVertexNZ(mesh, surf, i), magnitude=Sqr(nx*nx + ny*ny + nz*nz), If Abs(magnitude-1.0) > 0.01 Then Print "Non-unit normal at vertex " + i. Forward-facing normal example: surface facing camera has NZ close to -1.0 (pointing toward viewer in negative Z). Backward-facing normal: surface facing away has NZ close to +1.0 (pointing forward). Normal generation: set via b3dVertexNormal or calculated via b3dUpdateNormals. Default normal: b3dAddVertex sets (0, -1, 0) = upward, NZ=0. Precision: double precision (64-bit float). Alternative: calculate from triangle cross product, use for view-dependent effects. Performance: fast direct array access. Typical values: forward face NZ ~ -1.0, backward face NZ ~ +1.0, side face NZ ~ 0.0, 45 degrees angle NZ ~ +/-0.707.