scimesh 0.3.2
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
transforms.h
Go to the documentation of this file.
1
7
8#pragma once
9
10#include <scimesh/mesh.h>
11
12namespace scimesh {
13
27void translate_mesh(Mesh &mesh, const Vec3 &translation);
28
42void scale_mesh(Mesh &mesh, const Vec3 &scale);
43
57void scale_mesh(Mesh &mesh, float uniform_scale);
58
75void rotate_mesh(Mesh &mesh, float angle_radians, const Vec3 &axis);
76
96void transform_mesh(Mesh &mesh, const Mat4 &matrix);
97
122Mesh mesh_from_fs(const std::vector<float> &fs_vertices,
123 const std::vector<uint32_t> &fs_faces,
124 const std::vector<float> &per_vertex_values = {},
125 const std::vector<uint8_t> &rgb_bytes = {},
126 bool detect_transparency = false);
127
128} // namespace scimesh
The Mesh — the central data structure for 3D geometry in scimesh.
glm::mat4 Mat4
4×4 floating-point matrix.
Definition types.h:65
glm::vec3 Vec3
3-component floating-point vector (xyz).
Definition types.h:46
void scale_mesh(Mesh &mesh, const Vec3 &scale)
Scale a mesh non-uniformly along each axis.
void rotate_mesh(Mesh &mesh, float angle_radians, const Vec3 &axis)
Rotate a mesh around an arbitrary axis.
Mesh mesh_from_fs(const std::vector< float > &fs_vertices, const std::vector< uint32_t > &fs_faces, const std::vector< float > &per_vertex_values, const std::vector< uint8_t > &rgb_bytes, bool detect_transparency)
Convert a FreeSurfer-format mesh (flat vertex/face arrays) to a scimesh Mesh.
void transform_mesh(Mesh &mesh, const Mat4 &matrix)
Apply an arbitrary 4×4 transformation matrix to a mesh.
void translate_mesh(Mesh &mesh, const Vec3 &translation)
Translate (move) a mesh by a displacement vector.
Definition transforms.cpp:7