|
scimesh 0.3.2
Headless CPU-only 3D software renderer for scientific mesh visualization
|
The main rendering engine. More...
#include <renderer.h>
Public Member Functions | |
| Image | render_mesh (const Mesh &mesh, const Camera &camera, const RenderOptions &options) |
| Render a single mesh to an image. | |
| Image | render_scene (const Scene &scene, const Camera &camera, const RenderOptions &options) |
| Render a scene (collection of meshes) to an image. | |
| Image | render_triangles_raw (const std::vector< Vec3 > &positions, const std::vector< Color > &colors, const Camera &camera, const RenderOptions &options) |
| Render raw triangles (no Mesh wrapper) to an image. | |
| Image | render_points_raw (const std::vector< Vec3 > &positions, const std::vector< Color > &colors, float radius, const Camera &camera, const RenderOptions &options) |
| Render a point cloud (spheres at each position) to an image. | |
The main rendering engine.
The Renderer produces 2D images from 3D geometry using a software rasterization pipeline:
For multiple meshes, use a Scene:
For programmatic point clouds or triangle soups:
Definition at line 73 of file renderer.h.
| Image scimesh::Renderer::render_mesh | ( | const Mesh & | mesh, |
| const Camera & | camera, | ||
| const RenderOptions & | options | ||
| ) |
Render a single mesh to an image.
| mesh | The mesh to render. |
| camera | The camera defining the viewpoint. |
| options | Rendering settings (size, lighting, etc.). |
Definition at line 31 of file renderer.cpp.
| Image scimesh::Renderer::render_points_raw | ( | const std::vector< Vec3 > & | positions, |
| const std::vector< Color > & | colors, | ||
| float | radius, | ||
| const Camera & | camera, | ||
| const RenderOptions & | options | ||
| ) |
Render a point cloud (spheres at each position) to an image.
Each point is drawn as a small filled circle of the given radius (in screen-space pixels). Points are depth-tested against each other and against previously drawn geometry.
| positions | Point positions in world space. |
| colors | Per-point colors (same size as positions). |
| radius | Screen-space radius of each point in pixels. |
| camera | The camera. |
| options | Rendering settings. |
Definition at line 77 of file renderer.cpp.
| Image scimesh::Renderer::render_scene | ( | const Scene & | scene, |
| const Camera & | camera, | ||
| const RenderOptions & | options | ||
| ) |
Render a scene (collection of meshes) to an image.
All meshes are drawn into the same image in the order they appear in the scene. Later meshes are drawn on top of earlier ones.
| scene | The scene containing one or more meshes. |
| camera | The camera. |
| options | Rendering settings. |
Definition at line 43 of file renderer.cpp.
| Image scimesh::Renderer::render_triangles_raw | ( | const std::vector< Vec3 > & | positions, |
| const std::vector< Color > & | colors, | ||
| const Camera & | camera, | ||
| const RenderOptions & | options | ||
| ) |
Render raw triangles (no Mesh wrapper) to an image.
Each consecutive triplet of positions forms a triangle. positions.size() must be a multiple of 3, and colors must have the same number of elements.
| positions | Flat array of vertex positions (3 per triangle). |
| colors | Per-vertex colors (same size as positions). |
| camera | The camera. |
| options | Rendering settings. |
Definition at line 54 of file renderer.cpp.