Sure. I will try these out. But then again this may solve the position but not the scale and orientation
let’s fix it step by step
@Deltakosh how does this look like?
https://playground.babylonjs.com/#B6XF7C#3
https://playground.babylonjs.com/#B6XF7C#4 this takes care of scale imo @Deltakosh
this is really great!!
for scaling, I could recommend to compare the distance between min and max of their respective bounding boxes and then scale accordingly
Yeah that’s what I did https://playground.babylonjs.com/#B6XF7C#4
@Deltakosh
what do you think about this?
Also for the direction do you have any ideas?
@Deltakoshi think it should be possible to find the normal corresponding to the point (positions[5211], positions[5212], positions[5213]) i.e. the center of forehead
The normals of this point can then be used to obtain the direction in which the hat mesh is supposed to point.
How to make a mesh point in a known direction?
You can do mesh.lookAt for that
Thanks for consistently nudging me in the right direction @Deltakosh
https://playground.babylonjs.com/#B6XF7C#5 Any suggestions on how to improve from here?