tortru Posted December 7, 2018 Share Posted December 7, 2018 Hello, I am trying to access the absolute positions of meshes inside a GLTF scene. But for all the meshes getAbsolutePosition() always returns 0,0,0. I tried several things (computeWorldMatrix, etc.) but it did not help. What am I doing wrong? Playground Link: https://www.babylonjs-playground.com/indexStable.html#XB5W4H Thank you in advance Quote Link to comment Share on other sites More sharing options...
Guest Posted December 7, 2018 Share Posted December 7, 2018 Well this means that they are all at 0, 0, 0 You can use the inspector to see their bounding boxes (as well as all position info) Perhaps the file is defined that way? Quote Link to comment Share on other sites More sharing options...
tortru Posted December 7, 2018 Author Share Posted December 7, 2018 Yes. In the inspector they are 0,0,0 too. Maybe I misunderstand something. But if the several (sub)meshes appear on different places inside the scene, doesn't that mean that they have different absolute positions? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted December 7, 2018 Share Posted December 7, 2018 Look at the vertex position data to see why (ie: 852 is far from world center): console.log('pp:', mesh.getPivotPoint()) console.log(mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind)) Quote Link to comment Share on other sites More sharing options...
tortru Posted December 7, 2018 Author Share Posted December 7, 2018 Yep. You are right. That really makes sense. Thank you. GameMonetize and brianzinn 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.