iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.1k stars 300 forks source link

Instanced 3D Tiles - Start Animation? #2428

Open bertt opened 1 week ago

bertt commented 1 week ago

Hi, how can I start an animation on Instanced 3D Tiles containing a windmill (blades are animated), sample https://www.itowns-project.org/itowns/examples/3dtiles_loader.html?tileset=https://bertt.github.io/cesium_issues/i3dm_animating/issue/tileset.json

image

On Cesium it works see https://bertt.github.io/cesium_issues/i3dm_animating/issue/

animated_windmill

AnthonyGlt commented 1 week ago

Apparently, we don't have any code to run the animations. They are accessible though. It looks like we are losing the name of the mesh when we are creating the instances from 3dtilesrenderer. So the animations can't hook to the mesh. Also, I've tried to make this animation works on iTowns, without success (from your issue) So some modif should be done in the external lib but also in iTowns

I've tried to use this to update the mixer:


  view.render = function render() {
                if(mixer){
                    mixer.update(clock.getDelta())

                }
                var g = view.mainLoop.gfxEngine;

                g.renderView(view);

};