Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instanced 3D Tiles - Start Animation? #2428

Open
bertt opened this issue Oct 7, 2024 · 3 comments
Open

Instanced 3D Tiles - Start Animation? #2428

bertt opened this issue Oct 7, 2024 · 3 comments
Assignees
Labels

Comments

@bertt
Copy link

bertt commented Oct 7, 2024

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

@bertt bertt added the bug 🐛 label Oct 7, 2024
@AnthonyGlt
Copy link
Contributor

AnthonyGlt commented Oct 10, 2024

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);

};



@Desplandis
Copy link
Contributor

Desplandis commented Oct 23, 2024

I had some doubts with the fact that AnimationMixer indeed supported instanced meshes, but it seems I was wrong! I managed to make it working in three with a simplified loader for the windmill glb file (i.e. GLTFLoader + traversal of the scene to convert each mesh to instanced meshes).

We have some work to do to make it working in itowns:

  • As @AnthonyGlt inferred, we lost some information when converting a mesh to an instanced mesh in 3d-tiles-renderer-js, leading to invalid references to meshes in animations. I will push a fix.
  • Rework our render loop to continuously draw instead of stopping drawing when there is no update scheduled. We could however force update with the current API to test the fixe in 3d-tiles-renderer-js and propose a first quick & dirty solution. I'll open a proposal.
  • Provide out-of-the-box support for 3D-Tiles animations (à la Cesium), we would need to have an update/animate function on 3D layers?

P.S.: I'm on holidays until the first week of november, I will tackle this issue when I'm back!

@yhzcode
Copy link

yhzcode commented Nov 5, 2024

@Desplandis I'm also looking forward to solving this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants