EJanuszewski Posted October 20, 2015 Share Posted October 20, 2015 Hi all, I'm currently going through Temechon's book, which I must say is very good, however at the point of playing around with multimaterials I seem to be pulling my hair out, here is a link to a playground I put together http://playground.babylonjs.com/#1K3BTQ, I looked at DK's tutorial on MSDN ( http://blogs.msdn.com/b/eternalcoding/archive/2013/07/10/babylon-js-using-multi-materials.aspx ) but I'm unsure of where the numbers come from to define the indice parameters sphere.subMeshes.push(new BABYLON.SubMesh(0, 0, verticesCount, 0, 900, sphere));sphere.subMeshes.push(new BABYLON.SubMesh(1, 0, verticesCount, 900, 900, sphere));sphere.subMeshes.push(new BABYLON.SubMesh(2, 0, verticesCount, 1800, 2088, sphere)); I don't suppose someone could maybe assist me on this and explain what I'm doing wrong, I'm fairly new to the world of 3D so maybe I'm just misunderstanding how it's meant to work. Thanks, Edward Quote Link to comment Share on other sites More sharing options...
adam Posted October 20, 2015 Share Posted October 20, 2015 I got it to work by making the numbers int values. http://playground.babylonjs.com/#1K3BTQ#1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 20, 2015 Share Posted October 20, 2015 You will also need to sort the vertices etc' : http://playground.babylonjs.com/#1K3BTQ#2 but rounding the number of indices will be the first thing to do :-) Quote Link to comment Share on other sites More sharing options...
jerome Posted October 20, 2015 Share Posted October 20, 2015 in my backlog :add per ring cylinder uvs and colors feature adam 1 Quote Link to comment Share on other sites More sharing options...
EJanuszewski Posted October 20, 2015 Author Share Posted October 20, 2015 Than's for the replies everyone, that's awesome, seems I picked the worst mesh to try learning how to use multimaterials 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.