Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Sources/Rendering/OpenGL/ImageResliceMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,14 +1131,18 @@ function vtkOpenGLImageResliceMapper(publicAPI, model) {
shaders.Fragment = FSSource;
};

/**
* Returns true if the normal is almost axis aligned.
* Has a side effect to normalize the vector.
*/
function isVectorAxisAligned(n) {
vtkMath.normalize(n);
const tmpN = [0, 0, 0];
for (let i = 0; i < 3; ++i) {
vec3.zero(tmpN);
tmpN[i] = 1.0;
const dotP = vtkMath.dot(n, tmpN);
if (dotP < -0.999 || dotP > 0.999) {
if (dotP < -0.999999 || dotP > 0.999999) {
return [true, i];
}
}
Expand Down
Loading