Dieterich Posted October 3, 2018 Share Posted October 3, 2018 How fill color/texture in CreateLines?? ?? Example to begin: http://www.babylonjs-playground.com/#RF9W9#546 Quote Link to comment Share on other sites More sharing options...
Guest Posted October 3, 2018 Share Posted October 3, 2018 I would recommend creating a polygon in this case: http://doc.babylonjs.com/how_to/polygonmeshbuilder Wingnut and Dieterich 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 4, 2018 Share Posted October 4, 2018 @Dieterich - Could use polygon mesh builder to make triangles, too. From another thread: Your warehouse triangles could have thickness, so perhaps use extrudeShape for those. (You are a pro at using extrude, yes). Did you know that BJS has a... var oneMesh = BABYLON.Mesh.MergeMeshes( [list, of, mesh, etc] ) feature? Might be useful. Or, you could parent all warehouse pieces to a single master parent. *shrug* Later. :) All in all, good luck with your polygon! Keep in mind that you can create a 2D PICTURE of a shape.... with transparent background, and put that texture onto a plane or sprite. With proper lighting, you will not be able to "see" that it is a shape painted onto a texture, mapped onto a plane. It will look almost identical to the polygon mesh-builder "thing". This info... in case you like texturing (2D shape-painting)... more than plotting polygon shapes. In certain cases, either way, works the same. The BabylonJS "dynamicTexture" also has options for painting in 2D... onto its "imageBuffer". Much like SVG, if you know what that is. Essentially, paint shapes/strokes/text onto a BJS Texture... with math or manual stroke/fill commands. Web search for 'DOM Context2d' for more info... if you want to try painting onto a dynamicTexture's 2D "canvas". Dieterich 1 Quote Link to comment Share on other sites More sharing options...
Dieterich Posted October 4, 2018 Author Share Posted October 4, 2018 Hi guys, there are so many options, but I always worry about choosing and best practice, in this case I decided to use PolygonMeshBuilder and apply the build function and defining the depth. one question, PolygonMeshBuilder accept only 2D option "Vector2"? https://www.babylonjs-playground.com/#PTTMVI#105 Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 4, 2018 Share Posted October 4, 2018 1 hour ago, Dieterich said: one question, PolygonMeshBuilder accept only 2D option "Vector2"? That is correct. You need to rotate the mesh for it to lie in any other plane. Dieterich 1 Quote Link to comment Share on other sites More sharing options...
Dieterich Posted October 4, 2018 Author Share Posted October 4, 2018 although hate to rotate the objects, the answer is valid, but I prefer advancing with coordinates .. ? that's all thank you Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 4, 2018 Share Posted October 4, 2018 Thought at first you wanted an edge as well as a fill and so did these PGs https://www.babylonjs-playground.com/#S7HM64#1 https://www.babylonjs-playground.com/#S7HM64#2 https://www.babylonjs-playground.com/#S7HM64#3 Happy playing ? ssaket, Wingnut and Dieterich 3 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 4, 2018 Share Posted October 4, 2018 Thx John! That is VERY cool! Hey Dieterich... those warehouse roof-cap triangles would look GOOOOOD with a texture in the middle and an edge around the outsides, I bet. Good building-building tools, happening everywhere! I like buildings made-of many little pieces, because later, when it's time to blow them up, they blow up REAL GOOD. Lots of debris. Yum! http://www.babylonjs-playground.com/#1JFDFW#10 (an exploder by Jerome. Click somewhere on red. POOM!) FUN! JohnK 1 Quote Link to comment Share on other sites More sharing options...
Dieterich Posted October 4, 2018 Author Share Posted October 4, 2018 Really good! @JohnK @Wingnut @Deltakosh thanks for the initial foot point & show extra potencial of tool. That's funny explosion, i don't stop click to BOOM. ? Thanks for all guys. ? 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.