MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ generate_parametric_surface() [1/2]

MAYAFLUX_API Kakshya::MeshData MayaFlux::Kinesis::generate_parametric_surface ( const std::function< glm::vec3(float u, float v)> &  fn,
uint32_t  u_segs,
uint32_t  v_segs 
)

Generate a mesh from an arbitrary parametric surface function.

fn maps (u, v) in [0,1]^2 to a world-space position. Normals are computed via finite differences on fn so they follow the surface exactly regardless of shape. UV is mapped directly from (u, v).

Any surface expressible as a function of two parameters is valid: torus, Möbius band, Klein bottle approximation, spherical harmonic deformation, audio-driven terrain, or any procedural form.

Parameters
fnSurface function: (u, v) -> glm::vec3.
u_segsSubdivisions along U. Clamped to minimum 1.
v_segsSubdivisions along V. Clamped to minimum 1.
Returns
MeshData ready for TRIANGLE_LIST draw.