|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| 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.
| fn | Surface function: (u, v) -> glm::vec3. |
| u_segs | Subdivisions along U. Clamped to minimum 1. |
| v_segs | Subdivisions along V. Clamped to minimum 1. |