|
scimesh 0.3.4
Headless CPU-only 3D software renderer for scientific mesh visualization
|
A clipping plane that can hide parts of the scene. More...
#include <types.h>
Public Attributes | |
| Vec3 | normal = Vec3(0.0f, 0.0f, -1.0f) |
| The plane normal vector. | |
| float | offset = 0.0f |
Signed distance of the plane from the origin along normal. | |
| PlaneSpace | space = PlaneSpace::WORLD |
| The space ClipPlane::normal and ClipPlane::offset refer to. | |
A clipping plane that can hide parts of the scene.
Geometry on the "negative" side of the plane is discarded, i.e. a point p is kept when dot(p, normal) + offset >= 0. Which space p lives in is selected by ClipPlane::space:
PlaneSpace::WORLD (default): p is the world-space position, so the plane is a fixed feature of the scene. Cutting the midsagittal plane of a brain mesh (normal = (-1,0,0), offset = 0) keeps cutting the same place while the camera orbits.PlaneSpace::EYE: p is the view-space (eye-space) position, i.e. p = view * p_world. The plane moves with the camera.The normal is normalized internally, and offset is always a signed distance in world units along the (normalized) normal — scaling the normal does not change the plane. A zero-length normal neutralizes the plane (it clips nothing) instead of discarding the whole scene.
Clip planes are useful for cross-section views (e.g., slicing through a brain mesh to show internal structures). Multiple planes are combined with a logical AND: only geometry kept by all planes is rendered.
The plane normal vector.
Points toward the "keep" side of the plane. It does not have to be unit-length: it is normalized internally, and ClipPlane::offset is always interpreted as a distance in world units.
Default: (0, 0, -1).
| float scimesh::ClipPlane::offset = 0.0f |
Signed distance of the plane from the origin along normal.
A point p is kept when dot(p, normal) + offset >= 0 in the space given by ClipPlane::space, so offset = -d puts the plane at distance d from the origin when the normal is unit-length.
Default: 0 (the plane passes through the origin).
| PlaneSpace scimesh::ClipPlane::space = PlaneSpace::WORLD |
The space ClipPlane::normal and ClipPlane::offset refer to.
Default: PlaneSpace::WORLD.