Hi community!
Recently, just out of curiousity, I tried to bend a hollow cylinder along a curve, applying a quaternion, getting with .setFromBasis()
method, to vertices.
And here is the result.
Demo:
https://codepen.io/prisoner849/full/LEEXaPw
So, the question is: do I use this method wrong, or do I do something wrong in general?
@hofk , any advice?
PS Using of quaternion’s .setFromUnitVectors()
gives the expected result
Demo:
https://codepen.io/prisoner849/full/oggQPWo
2 Likes
Try different order of the basis vectors (normal->binormal->tangent):
new THREE.Quaternion().setFromBasis(
tbn.normals[qIdx],
tbn.binormals[qIdx],
tbn.tangents[qIdx],
);
5 Likes
PavelBoytchev:
Try different order
That’s why I like our community
Thanks
PS Should’ve thought about it myself though
2 Likes
hofk
May 12, 2025, 4:37pm
4
prisoner849:
any advice?
I’m probably too late to look at that. But I’ve fallen for it myself before and just had the wrong order. It took me a while to finally realize that.
2 Likes