JohnK Posted June 30, 2017 Share Posted June 30, 2017 After my last excursion into building a house with BJS the corners bugged me a little as they were basically different wall butted together with one edge showing. Also you had to make individual walls and place them correctly. Plans for a house are often shown as just a floor plan so I began to wonder if I could build a house from a floor plan. At this stage just taking a plan and entering measurement as data into the floor plan builder. This is the result http://www.babylonjs-playground.com/#4GBWI5#2 You can read how to use the buildFromPlan function here http://babylonjsguide.github.io/gamelets/House#the-function-and-how-to-use-it and there are more details about its construction. One thing I have yet to fully write about is setting the interior and exterior textures and colors but this uses the same method as Jerome's faceUV and faceColors method but instead of an array being needed there a just two parameters to set. The other main point about the uvs is that I have set them so that they are scaled according the width of the wall. If the width of the longest wall is 1 and there is a wall of half this length then only half the texture image is used for this wall. In other words if the texture is stripes and the longest wall is covered by 20 vertical stripes then the half sized wall will be covered by 10 vertical stripes. Who knows perhaps I will tackle roofs next. iiceman, jerome, inteja and 4 others 7 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 1, 2017 Share Posted July 1, 2017 excellent ! Quote Link to comment Share on other sites More sharing options...
Convergence Posted July 8, 2017 Share Posted July 8, 2017 Very cool, any chance there could be a tutorial for the PolygonMeshBuilder in conjunction with the angled corners? Would it work for curved walls? Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 9, 2017 Author Share Posted July 9, 2017 On 08/07/2017 at 7:35 AM, Convergence said: Very cool, any chance there could be a tutorial for the PolygonMeshBuilder in conjunction with the angled corners? Would it work for curved walls? There is a tutorial for PolygonMeshBuilder but not in conjunction with the angled corners. Studying the construction of the angled section it it made from three angled walls. Each wall is made up of a base, two sides, a top and an interior and exterior rectangle, with holes for windows and doors. PolygonMeshBuilder is only used for the interior and exterior rectangles and the holes for windows. Notice that each window is wholly inside one of these angles walls, there is no provision for making a single window that goes across all three angled walls. To make a curved wall you would need to replace the three angles walls with many angled walls at the correct positions and angles, which can be done but you could not have doors and windows in it. To provide for curved ( or angled section, eg bays) then I would need to add code for a curved wall that could cope with doors and windows. Perhaps I might look at that some time next week. To show curved walls (without doors or windows) http://www.babylonjs-playground.com/#4GBWI5#5 is possible but not straightforward to achieve. Convergence 1 Quote Link to comment Share on other sites More sharing options...
Convergence Posted July 30, 2017 Share Posted July 30, 2017 On 7/9/2017 at 4:59 PM, JohnK said: There is a tutorial for PolygonMeshBuilder but not in conjunction with the angled corners. Studying the construction of the angled section it it made from three angled walls. Each wall is made up of a base, two sides, a top and an interior and exterior rectangle, with holes for windows and doors. PolygonMeshBuilder is only used for the interior and exterior rectangles and the holes for windows. Notice that each window is wholly inside one of these angles walls, there is no provision for making a single window that goes across all three angled walls. To make a curved wall you would need to replace the three angles walls with many angled walls at the correct positions and angles, which can be done but you could not have doors and windows in it. To provide for curved ( or angled section, eg bays) then I would need to add code for a curved wall that could cope with doors and windows. Perhaps I might look at that some time next week. To show curved walls (without doors or windows) http://www.babylonjs-playground.com/#4GBWI5#5 is possible but not straightforward to achieve. Sorry for the late reply hehe. I'll table my desire for curved walls for now :D, easier to just ExtrudePath a curved path to create a curved mesh without holes 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.