imxood Posted September 8, 2016 Share Posted September 8, 2016 (Sorry, my English is poor..) I want to use babylon file to load my scene(a box), and want to use DynamicTexture to update the box, but there isnot word showed on the box......however,I get a box by using BABYLON.Mesh.CreateBox, use DynamicTexture to update the box, there are words showed on the box here, code: //load mesh BABYLON.SceneLoader.ImportMesh("", "res/", "demo.babylon", scene, function(newMeshes, particleSystems) { scene.debugLayer.show(); //dynamicTexture var wordTexture = new BABYLON.DynamicTexture("dynamic texture", 512, scene, true); wordTexture.drawText("me from Mars", null, 80, "bold 70px Segoe UI", "red", "#555555"); //material var dyMaterial = new BABYLON.StandardMaterial("dyMaterial", scene); dyMaterial.diffuseTexture = wordTexture; //Box001, the mesh from babylon file Box001 = scene.getMeshByName("Box001"); Box001.material = dyMaterial; //Box002 Box002 = BABYLON.Mesh.CreateBox("Box002",6.0,scene,false,BABYLON.Mesh.DEFAULTSIDE); Box002.material = dyMaterial; }); very thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 8, 2016 Share Posted September 8, 2016 Hello this seems like your box has no texture coordinates (uv). Which tool are you using to generate it? Quote Link to comment Share on other sites More sharing options...
imxood Posted September 9, 2016 Author Share Posted September 9, 2016 10 hours ago, Deltakosh said: Hello this seems like your box has no texture coordinates (uv). Which tool are you using to generate it? I'm sorry to click "Report post" for replying you, my English is pool, ,crying....... Dear sir, I use 3dsmax... for my problem, I can't know what to do, in 3dsmax, I made a plane, and exported to babylon file. in javascript, in the plane, BABYLON.Texture work, but BABYLON.DynamicTexture doesn't work with showing black; sir, this problem has been bothering me for two days, but I have no way,, //load mesh BABYLON.SceneLoader.ImportMesh("", "res/", "demo.babylon", scene, function(newMeshes, particleSystems) { //scene.debugLayer.show(); //DynamicTexture var dynamiTexture = new BABYLON.DynamicTexture("dynamiTexture", 1000, scene, true);//new BABYLON.Texture("res/pic.jpg", scene); dynamiTexture.drawText("- me from Mars...", null, 80, "40px Segoe UI", "red", null); //Material var dynamiTextureMaterial = new BABYLON.StandardMaterial("dynamiTextureMaterial", scene); dynamiTextureMaterial.diffuseTexture = dynamiTexture; dynamiTextureMaterial.backFaceCulling = false; //Plane002 var Plane002 = scene.getMeshByName("Plane002"); Plane002.material = dynamiTextureMaterial; }); Thank you very very much for your comment!! Quote Link to comment Share on other sites More sharing options...
imxood Posted September 9, 2016 Author Share Posted September 9, 2016 10 hours ago, Deltakosh said: Hello this seems like your box has no texture coordinates (uv). Which tool are you using to generate it? 3DS Max to Babylon.js exporter 3dmax 2016 Quote Link to comment Share on other sites More sharing options...
imxood Posted September 9, 2016 Author Share Posted September 9, 2016 10 hours ago, Deltakosh said: Hello this seems like your box has no texture coordinates (uv). Which tool are you using to generate it? "this seems like your box has no texture coordinates (uv) ", I am not familiar with 3dsmax Quote Link to comment Share on other sites More sharing options...
imxood Posted September 9, 2016 Author Share Posted September 9, 2016 Deltakosh Quote Link to comment Share on other sites More sharing options...
imxood Posted September 9, 2016 Author Share Posted September 9, 2016 Weak weak ask , I reply way right? Quote Link to comment Share on other sites More sharing options...
dbawel Posted September 9, 2016 Share Posted September 9, 2016 Your 1st box appears to have no UV texture coordinates as DK said. First, I would assign a texture to your box in Max and then place the dynamic texture on a seperate channel. Also, try exporting using FBX and import into Blender to try and undersand the workflow a bit better. Also, I use both Maya and 3DSMax, and almost always export FBX to Blender - and then to .babylon, and have few issues. I would assume that your transforms on the 1st (larger) box (cube) are not at a scale of (1,1,1). If you want to try your scene again and bypass the learning curve, reset all transformes before exporting. This will probably not solve your problem, but always a good step before exporting any objects for many reasons. If you are exporting to FBX, the are known material issues exporting from 3DSMax - which is why I recommend using Blender first as a test. There is definately a process that must be entirely understood in unwrapping UVs to be compatible with the babylon.js framework. DB 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.