Search the Community
Showing results for tags 'updateverticesdata'.
-
Is the following correct or is there a better way of adding vertex colors to a mesh? When you have a mesh with `mesh..getVerticesData(BABYLON.VertexBuffer.ColorKind)` returning null then you cannot use 'updateVerticesData' since there in no colorKind array to update as exampled in https://www.babylonjs-playground.com/#ZRZIIZ So to add vertex colors you need to copy the mesh data and create a new mesh with vertex colors and dispose of the original as in https://www.babylonjs-playground.com/#ZRZIIZ#1
-
Hi it's me again hope you guys don't mind me asking all these questions but i have a small problem. So i have a custom mesh and the mesh is dynamic and needs to get updated so this is how i do it: var positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); // edit positions mesh.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions); Then when i moveWithCollisions the collisions are not updated. I have worked out a few ways to update the collisions but i'm not sure what is the correct/fastest method 1) mesh.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions, false, true); 2) mesh.setIndices(mesh.getIndices()); 3) mesh.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions); Whats the correct/fastest method?
-
If we position a object off center and edit the mesh with UpdateVerticesData collisions stop working correctly PLAYGROUND DEMOING BUG http://www.babylonjs-playground.com/#NTUKO#2 i believe this bug is related to this bug: