masterdon Posted August 11, 2017 Share Posted August 11, 2017 Hello everyone. I am trying to create and L shaped and inverse L shaped room structure using paths that connects 6 points. The path array is passed to ribbon function. however i am not getting the desired result. Here is the code for same: function drawRoomType2() { var mat = new BABYLON.StandardMaterial("mat1", scene); mat.alpha = 1.0; mat.diffuseColor = new BABYLON.Color3(0.5, 0.5, 1.0); mat.backFaceCulling = false; var sideO = BABYLON.Mesh.DEFAULTSIDE;; var pathArray = []; var subPath1 = []; for (var i = 10; i < 100; i++) { subPath1.push(new BABYLON.Vector3(i, 2, 11)); } pathArray.push(subPath1); var subPath2 = []; for (var i = 11; i < 99; i++) { subPath2.push(new BABYLON.Vector3(100, 2, i)); } //subPath2.push(new BABYLON.Vector3(100, 2, 11)); //subPath2.push(new BABYLON.Vector3(100, 2, 99)); pathArray.push(subPath2); var subPath3 = []; for (var i = 100; i < 50; i--) { subPath3.push(new BABYLON.Vector3(i, 2, 99)); } //subPath3.push(new BABYLON.Vector3(100, 2, 99)); //subPath3.push(new BABYLON.Vector3(50, 2, 99)); pathArray.push(subPath3); var subPath4 = []; for (var i = 99; i < 49; i--) { subPath4.push(new BABYLON.Vector3(50, 2, i)); } //subPath4.push(new BABYLON.Vector3(50, 2, 99)); //subPath4.push(new BABYLON.Vector3(50, 2, 49)); pathArray.push(subPath4); var subPath5 = []; for (var i = 50; i < 10; i--) { subPath4.push(new BABYLON.Vector3(i, 2, 49)); } //subPath5.push(new BABYLON.Vector3(50, 2, 49)); //subPath5.push(new BABYLON.Vector3(10, 2, 49)); pathArray.push(subPath5); var subPath6 = []; subPath6.push(new BABYLON.Vector3(10, 2, 49)); subPath6.push(new BABYLON.Vector3(100, 2, 11)); pathArray.push(subPath6); var mesh = BABYLON.Mesh.CreateRibbon("ribbon", pathArray, false, false, 0, scene, true, sideO); mesh.material = mat; } Quote Link to comment Share on other sites More sharing options...
jerome Posted August 11, 2017 Share Posted August 11, 2017 As we don't know what you get and what you expect, it might be a bit hard to help you ... [EDIT] I mean : could you please make a PG ? Quote Link to comment Share on other sites More sharing options...
masterdon Posted August 11, 2017 Author Share Posted August 11, 2017 @jerome: Hi Jerome. I wanted to create L shaped room and shade inner area. something like this But getting a weird shape. here is the link to playground http://www.babylonjs-playground.com/#SUXKHY#42 Quote Link to comment Share on other sites More sharing options...
jerome Posted August 11, 2017 Share Posted August 11, 2017 something like that : https://www.babylonjs-playground.com/#FTZNV8 plain : https://www.babylonjs-playground.com/#FTZNV8#1 I would suggest that you isolate your problem in your PG to get better help from the forum, because it embbeds too much useless code about the very issue masterdon 1 Quote Link to comment Share on other sites More sharing options...
masterdon Posted August 11, 2017 Author Share Posted August 11, 2017 @jerome : Awesome....exactly what i wanted. thanks a lot 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.