molstar
molstar copied to clipboard
Investigate non-normalized normals
Investigate non-normalized normals observed by @sukolsak in #174.
Hey @sukolsak, not sure if I remember correctly: was there another source of non-normalized normals?
@arose There are two sources that I have found so far:
- Normals in arrowheads. See #179
- The
add*Cylindermethods. These methods callMeshBuilder.addPrimitive(state, tmpCylinderMat, cylinder), which does this
const n = mat3directionTransform(tmpMat3, t);
...
// normal
v3transformMat3(tmpV, v3fromArray(tmpV, na, i), n);
tmpV is not normalized because of the non-uniform scaling of cylinders.