96fcd05511
Auditoria del issue 0044: 9 archivos .md de cpp/functions/viz/ con uses_functions actualizado. Resuelve dependencias detectadas via #include: plot_static (consumido por bar_chart, histogram, line_plot, pie_chart, scatter_plot), gl_loader, gl_framebuffer, gl_shader, graph_force_layout, graph_renderer, graph_spatial_hash, orbit_camera, sparkline y tokens. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.4 KiB
2.4 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, emits, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | framework | emits | output | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| mesh_viewer | component | cpp | viz | 1.0.0 | impure | void mesh_viewer(const char* id, const MeshViewerConfig& cfg) | Renderiza un MeshGpu (3D) en un FBO interno cacheado por id, con orbit camera, iluminacion Lambert headlight, opcion wireframe. Drag/wheel del mouse mueven la camara. |
|
|
false | error_go_core |
|
false | cpp/functions/viz/mesh_viewer.cpp | imgui |
|
Renderiza una imagen del mesh dentro del frame ImGui actual; muta cfg.cam in-place segun drag/wheel del mouse cuando el panel esta active/hovered. |
mesh_viewer
Componente de viz para inspeccionar geometria 3D dentro de cualquier panel ImGui. Internamente:
- Compila/cachea (por
id) un programa shader Lambert headlight (vertex + fragment). - Cachea un
Framebufferporidy lo redimensiona seguncfg.size. - Cada frame: bind FBO, draw
cfg.mesh, mostrar la textura viaImGui::Image. - Si el panel esta active → llama
orbit_camera_handle_dragconMouseDelta. - Si el panel esta hovered y hay scroll → ajusta zoom.
Ejemplo
static fn::core::OrbitCamera cam;
fn::viz::MeshViewerConfig cfg{};
cfg.mesh = &gpu; // MeshGpu valido
cfg.cam = &cam;
cfg.size = {-1, 480};
cfg.wireframe = false;
cfg.color = IM_COL32(160, 200, 255, 255);
fn::viz::mesh_viewer("##teapot_view", cfg);
Notas
- Sin depth buffer: el FBO solo tiene attachment color (sigue el patron de
gl_framebuffer). Para meshes complejos con auto-oclusion, esto produce artefactos. Issue futuro puede añadir depth/stencil renderbuffer. - Wireframe: usa
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)(no disponible en GL ES; protegido con#ifndef __EMSCRIPTEN__). - Cache por id: si el
idcambia dinamicamente entre frames, se acumulan FBOs y programas en memoria (leak). Usar IDs estables. - Iluminacion: Lambert con luz fija en
+Zview-space ("headlight"), suficiente para inspeccion. Sin specular, sin sombras. - Matrices: row-major desde
orbit_camera_matrices; se suben contranspose=GL_TRUE(GL espera column-major).