scimesh 0.3.2
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
normals.h File Reference

Compute per-vertex surface normals for lighting. More...

#include <scimesh/mesh.h>
#include <scimesh/math_utils.h>
Include dependency graph for normals.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  scimesh
 

Functions

void scimesh::compute_vertex_normals (const Mesh &mesh, std::vector< Vec3 > &normals)
 Compute per-vertex normals by averaging adjacent face normals.
 

Detailed Description

Compute per-vertex surface normals for lighting.

Surface normals are direction vectors perpendicular to the surface at each vertex. They are essential for lighting — without normals, the renderer cannot tell which way a surface is facing and cannot compute shading.

Definition in file normals.h.