med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

370
active users

#threejs

7 posts3 participants1 post today

Can anybody help me with some #ThreeJS maths?
I have a plane (really a very thin box geometry) which I want to rotate so that its normal is a given vector.
How do I do that? I've tried `.lookAt(vector)` but can't get it to do the right thing, and not even a cyclic permutation of the dimensions fixes it.
Every attempt I've made to set the rotation to a quaternion which I think should match the normal goes wrong.
It feels like this should be a really common task. What am I missing?

EDIT: now sorted. I hadn't spotted which methods work with the local vs object spaces.