peraxel7 Posted August 14, 2016 Share Posted August 14, 2016 Hi, new to Babylon.js and the forum. I want to use the renderOutline property on the rabbit.babylon model from BONES demo. BABYLON.SceneLoader.ImportMesh("", "models/", "rabbit.babylon", scene, function (newMeshes, particleSystems, skeletons) { var mdl_Rabbit = newMeshes[0]; mdl_Rabbit.position = new BABYLON.Vector3(0, 0, 40); mdl_Rabbit.renderOutline = true; }); It changes the position of the rabbit but it does not render outline. Also for some reason, I could use newMeshes[12] and the rabbit would still display correctly. mdl_Rabbit.showBoundingBox doesn't work either. Overall it's obvious I don't understand how the ImportMesh works. So, what am I missing and how do I get renderOutline to work? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 15, 2016 Share Posted August 15, 2016 Hello you can turn debugLayer on to check how many meshes where imported, what's their name and where they are just run scene.debugLayer.show() Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted August 15, 2016 Share Posted August 15, 2016 Hi @peraxel7 it might already be working, but very hard to see. try adding outlineWidth and outlineColor to make it more visible, see example below of skull PG demo. http://www.babylonjs-playground.com/#18ZFZ9 Update; I just tried doing it on the rabbit, and it doesn't work out of the box because the rabbit is made out of several meshes, in which case you need to "apply" the outline on each mesh. see; http://www.babylonjs-playground.com/#18ZFZ9#2 Pryme8 and peraxel7 2 Quote Link to comment Share on other sites More sharing options...
peraxel7 Posted August 15, 2016 Author Share Posted August 15, 2016 Ok, got it working now. I was actually surprised that debugLayer could show the bounding box whereas I had failed. Thanks for the comments. Iterating all the meshes to outline all of them will probably come into use one of these days at well. Turns out I needed to set newMeshes[0] to newMeshes[1]. At least I got to spend a few hours reading the documentation Onwards to the next user error! Nabroski 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.