i'll explain problem i'm facing, cause i'm doing wrong.
i have models in blender, these exported json , used in three.js. in these models there planes, in js replaced on flight mesh enable cloth simulation.
the models can rotate once in scene, , these planes being children of models rotate. moreover, original planes blender have rotation applied.
however want wind global, each plane , each frame, global (world) wind direction vector cloned , transformed local coordinates of each plane, cloth particles can moved correctly.
this accomplished :
globaldir = new three.vector3(0,0,1); // wind north // ... var localdir = plane.worldtolocal(globaldir.clone()); // use localdir vector moving around vertices base don wind
this "works", meaning clothes children of single model aligned same global wind, :
- nothing else changing, refreshing page, given same values globaldir vector, wind direction different.
- from model model, direction different.
it seems how world matrix gets updated relatively object hierarchy, on order models loaded , added, , on.
i've been trying add , remove calls updatematrix , updatematrixworld everywhere around, i'm asking guidelines how methods updatematrix, updatematrixworld, localtoworld , worldtolocal supposed used.