From 1844fc14b209b9053c5adba69eac51a03bdeb0d1 Mon Sep 17 00:00:00 2001 From: Sukolsak Sakshuwong <sukolsak@gmail.com> Date: Sun, 27 Jun 2021 13:14:30 -0700 Subject: [PATCH] fix cylinder orientation --- src/mol-geo/geometry/mesh/builder/cylinder.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mol-geo/geometry/mesh/builder/cylinder.ts b/src/mol-geo/geometry/mesh/builder/cylinder.ts index ba136daeb..239b7f618 100644 --- a/src/mol-geo/geometry/mesh/builder/cylinder.ts +++ b/src/mol-geo/geometry/mesh/builder/cylinder.ts @@ -31,6 +31,7 @@ function setCylinderMat(m: Mat4, start: Vec3, dir: Vec3, length: number, matchDi // ensure the direction used to create the rotation is always pointing in the same // direction so the triangles of adjacent cylinder will line up if (matchDir) Vec3.matchDirection(tmpUp, up, tmpCylinderMatDir); + else Vec3.copy(tmpUp, up); Mat4.fromScaling(tmpCylinderMatScale, Vec3.set(tmpCylinderScale, 1, length, 1)); Vec3.makeRotation(tmpCylinderMatRot, tmpUp, tmpCylinderMatDir); Mat4.mul(m, tmpCylinderMatRot, tmpCylinderMatScale); -- GitLab