Transforms normal vector from src_entity space to dest_entity space and normalizes (stores in g_lastTFormedResult, retrieve with b3dTFormedX/Y/Z).
Takes x/y/z (normal vector in src space), src_entity (source coordinate system, 0=world space), dest_entity (destination coordinate system, 0=world space).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
xDouble
yDouble
zDouble
src_entityInt
dest_entityInt
Returns
Void
Quick Summary
Transforms normal vector from src_entity space to dest_entity space and normalizes (stores in g_lastTFormedResult, retrieve with b3dTFormedX/Y/Z).
Takes x/y/z (normal vector in src space), src_entity (source coordinate system, 0=world space), dest_entity (destination coordinate system, 0=world space).
Returns nothing.
Technical Exegesis...
Transforms normal vector from src_entity space to dest_entity space and normalizes (stores in g_lastTFormedResult, retrieve with b3dTFormedX/Y/Z). Takes x/y/z (normal vector in src space), src_entity (source coordinate system, 0=world space), dest_entity (destination coordinate system, 0=world space). Returns nothing. Calls b3dTFormVector to transform vector (rotation only), normalizes result to unit length using XMVector3Normalize, stores in g_lastTFormedResult. Ensures output is unit-length normal.
Transforms normal vector from src_entity space to dest_entity space and normalizes (stores in g_lastTFormedResult, retrieve with b3dTFormedX/Y/Z). Takes x/y/z (normal vector in src space), src_entity (source coordinate system, 0=world space), dest_entity (destination coordinate system, 0=world space). Returns nothing. Calls b3dTFormVector to transform vector (rotation only), normalizes result to unit length using XMVector3Normalize, stores in g_lastTFormedResult. Ensures output is unit-length normal.
This function transforms surface normals. Normal transformation: uses b3dTFormVector for rotation-only transform (no scale/translation), then normalizes to preserve unit length (length=1.0), critical for lighting calculations. Normalization: result = normalize(transformed vector), ensures length=1.0 even if rotation or scaling distorts length, prevents lighting errors from non-unit normals. Use cases: (1) Lighting calculations (transform surface normals for per-vertex lighting), (2) Collision response (transform contact normals between coordinate systems), (3) Reflection/refraction (transform incident/reflect normals), (4) Normal mapping (transform tangent-space normals to world space), (5) Physics simulations (transform force normals). Common pattern: b3dTFormNormal(normalX, normalY, normalZ, mesh, 0), worldNX=b3dTFormedX(), worldNY=b3dTFormedY(), worldNZ=b3dTFormedZ(). Typical usage: transform mesh surface normals from local to world space for lighting, transform world normals to view space for shaders. Normal vs vector: b3dTFormNormal normalizes output (unit length guarantee), b3dTFormVector preserves length (no normalization), use TFormNormal for surface normals (lighting, collision), use TFormVector for directions (velocities, offsets). Y-axis negation: input/output in user space (+Y up), internal calculations in DirectX space (-Y up), automatic negation both directions (handled by b3dTFormVector). Result retrieval: call b3dTFormedX/Y/Z() to get transformed normal components. Performance: O(1) vector transform + normalize (fast, suitable for per-vertex transforms), typically used during mesh preprocessing or runtime normal transforms. Related: b3dTFormVector transforms directions without normalization, b3dTFormPoint transforms positions with translation, b3dTFormedX/Y/Z retrieve transformed result.