Set plane orientation

There are 3 methods you should familiarize yourself with…

object.attach( object )
object.worldToLocal( point )
object.localToWorld( point )

.attach works differently than .add. It tries to keep the visual representation of the object the same, while changing its parent.
So in your case with having the correct result on the skin, and then wanting to put that result in the bone space… You may be able to just bone.attach( helperPlane ) after you set up the helperplane in the scene first like you are doing.

worldToLocal takes a point in world space, and converts it to local space of an object. This takes into account any parent/child hierarchy in between, and trying to do this manually with matrices is a pain.

localToWorld takes a point in local object space, and converts it to world space. This takes into account any parent/child hierarchy in between, and trying to do this manually with matrices is a pain.

So… it’s Good to learn about matrices and transforms etc. but once you’ve internalized it, you can often avoid having to deal directly with matrices, by just using those 3 functions I mentioned above.

1 Like