nytimes / three-loader-3dtiles

This is a Three.js loader module for handling OGC 3D Tiles, created by Cesium. It currently supports the two main formats, Batched 3D Model (b3dm) - based on glTF Point cloud.
Other
454 stars 64 forks source link

Add getRootTransformationMatrix to runtime #149

Open tobias74 opened 6 months ago

tobias74 commented 6 months ago

Hello again :-)

In my usecase I needed access to the current transformation matrix (threeMat) because I was animating a 3d-model along a given path. The coordinates of the model were given in a local coordinate system. On every animation frame I would transform the local coordinates to be displayed on the 3dtiles. Now since I adjust the 3dtiles transformation periodically I need a way to read the current transformation back from the ties runtime, so that I can apply it to the coordinates of the 3d-model.

Best regards Tobias

Avnerus commented 6 months ago

Hi @tobias74! I think the so called threeMat should be equal to new THREE.Matrix4().fromArray(runtime.getTileset().modelMatrix). Could you try that?