mattx264 Posted March 18, 2014 Share Posted March 18, 2014 BABYLON.SceneLoader.ImportMesh("", "../Content/flag3d/", "untitled.babylon", scene, function (newMeshes, particleSystems) { for (var i = 0; i < newMeshes.length; i++) { if (newMeshes.name == "plakietka2" || newMeshes.name == "gwozdz") { var obj; var positionY = newMeshes.position.y; for (var j = 0; j < 10; j++) { obj = newMeshes.clone("c" + j); positionY -= 50 var backgroundTexture = new BABYLON.DynamicTexture("dynamic texture", 512, scene, true); backgroundTexture.drawText("Eternalcoding"+j , null, 80, "bold 50px Segoe UI", "white", "#555555");//set different name obj.position = new BABYLON.Vector3(0, positionY, 0); obj.material.diffuseTexture = backgroundTexture; obj.material.specularColor = new BABYLON.Color3(0, 0, 0); obj.material.backFaceCulling = false; } }} Quote Link to comment Share on other sites More sharing options...
mattx264 Posted March 18, 2014 Author Share Posted March 18, 2014 My question is (I don't know why it doesn't show up), so mesh is cloning and i can set position for each cloned mesh, but i set texture for each different text it is the same for every. My question is how to clone texture.Thank you. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 18, 2014 Share Posted March 18, 2014 My question is how to clone texture.var cloneTexture = backgroundTexture.clone("dynamic texture clone"); I don't know why it doesn't show upBABYLON.SceneLoader.ImportMesh("plakietka2", "../Content/flag3d/", "untitled.babylon", scene, function (newMeshes, particleSystems) The name must match the name in the mesh of babylon file Quote Link to comment Share on other sites More sharing options...
mattx264 Posted March 18, 2014 Author Share Posted March 18, 2014 I doesn't work, every cloned mesh have text="Eternalcoding9" Quote Link to comment Share on other sites More sharing options...
gwenael Posted March 18, 2014 Share Posted March 18, 2014 I think for this case it's not possible since by drawing text it's like you are loading a new picture so it's not the same texture. Quote Link to comment Share on other sites More sharing options...
mattx264 Posted March 18, 2014 Author Share Posted March 18, 2014 so, how best to resolve it. Thank you for any help. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 18, 2014 Share Posted March 18, 2014 You have to create a new texture for each of them and subsenquently a new material for each of them 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.