scimesh 0.3.4
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
45void scale_mesh(Mesh &mesh, const Vec3 &scale);
46
62void scale_mesh(Mesh &mesh, float uniform_scale);
63
81void rotate_mesh(Mesh &mesh, float angle_radians, const Vec3 &axis);
82
107void transform_mesh(Mesh &mesh, const Mat4 &matrix);
108
131void flip_uvs(Mesh &mesh);
132
157Mesh mesh_from_fs(const std::vector<float> &fs_vertices,
158 const std::vector<uint32_t> &fs_faces,
159 const std::vector<float> &per_vertex_values = {},
160 const std::vector<uint8_t> &rgb_bytes = {},
161 bool detect_transparency = false);
162
163} // 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
void flip_uvs(Mesh &mesh)
Flip the texture coordinates of a mesh vertically (v → 1 − v).
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.
int x
Left edge of the bitmap, in image pixels.
Definition text.cpp:223