JohnK Posted February 27, 2018 Share Posted February 27, 2018 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 Quote Link to comment Share on other sites More sharing options...
Gijs Posted February 27, 2018 Share Posted February 27, 2018 You can use setVerticesData: https://www.babylonjs-playground.com/#ZRZIIZ#2 JohnK and GameMonetize 1 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted February 27, 2018 Author Share Posted February 27, 2018 @Gijs knew there had to be a better way 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.