tham_kathy Posted September 8, 2018 Share Posted September 8, 2018 I need to apply a texture to the customMesh. But it's showing me an error message saying "Vertex buffer is not big enough for the draw call" The code I wrote is below. var wall_color = new BABYLON.StandardMaterial("wall_color", scene); wall_color.diffuseTexture = new BABYLON.Texture("http://i.imgur.com/Vw4fzwq.jpg", scene); build.material = wall_color; The code I apply the above lines is; http://www.babylonjs-playground.com/#4GBWI5 Need help to solve this problem. Appreciate your help. Quote Link to comment Share on other sites More sharing options...
Gijs Posted September 8, 2018 Share Posted September 8, 2018 You need to provide the uv data, it's empty in your code Quote Link to comment Share on other sites More sharing options...
tham_kathy Posted September 8, 2018 Author Share Posted September 8, 2018 I tried with different uv values but the texture is not appearing as it is. The way I calculated uv values is; var uvs = []; for(var p = 0; p < positions.length / 3; p++) { uvs.push((positions[3 * p] - (-4)) / 6, (positions[3 * p + 1] - (-4)) / 8); } Can you please suggest me a way to apply the texture as it is for both outer walls and inner walls separately? Quote Link to comment Share on other sites More sharing options...
JohnK Posted September 8, 2018 Share Posted September 8, 2018 This is one way http://www.babylonjs-playground.com/#4GBWI5#2 Gijs 1 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.