tham_kathy Posted July 7, 2018 Share Posted July 7, 2018 I want to create a roof for each house that I'm generating. Roof should be created on top of the walls. So I want to create the roof using the footprint coordinate values. Plz give me a solution Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 7, 2018 Share Posted July 7, 2018 Hi thamali, welcome to the forum. First, I'm going to assume that "footprint" is almost the same as "building foundation". Footprint is a good term, but might be confusing to some readers. Umm... you need to "sum" the bounding-areas of all the walls. I think there is a function nearby... which does that. I'm searching. Help needed from others, please. (I will keep looking, though.) I think, if you meshMerge all the wall meshes... then you can do... var myTapeMeasure = mergedMesh.getBoundingInfo().boundingBox; Then examine the properties on your tape measure object, and you will see some useful values. Stay tuned... better answers are nearby. Does anyone have/know-of a function that ... sums the bounding-volumes of an array of positioned mesh? Thx! Post url/info here, please. tham_kathy 1 Quote Link to comment Share on other sites More sharing options...
dbawel Posted July 7, 2018 Share Posted July 7, 2018 @thamali It all depends on how you're constructing the walls representing each footprint. @Wingnut has a potential solution, but it all depends on how you're generating the geometry which you roof is dependent. DB tham_kathy 1 Quote Link to comment Share on other sites More sharing options...
tham_kathy Posted July 7, 2018 Author Share Posted July 7, 2018 Thanks for the replies @dbawel and @Wingnut Actually I am very new to babylon js so I really appreciate your help. I'm going to build walls using below example http://www.babylonjs-playground.com/#4GBWI5 Quote Link to comment Share on other sites More sharing options...
dbawel Posted July 9, 2018 Share Posted July 9, 2018 @thamali You have all of the information you require in your 'buildFromPlan' function to accomplish this. Just use selected info from this function and add the roof within the function. If this isn't clear enough to you right now. then I'm certain I or someone else on this forum can modify the PG scene to demonstrate how. I'll try to get to it soon, but due to the 42C degree temperatures her right now, my internet connection is only up for a few minutes or hours at night when the temperature drops a bit. I'm expecting this to get better as the temperature should be in the 30C's tomorrow. At least I hope. @Wingnut... want to help him out? DB tham_kathy 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 9, 2018 Share Posted July 9, 2018 Cool wall-generator code, Thamali! You are driving BJS/JS quite well... considering you are "new". Thx for providing that useful playground demo. @dbawel... squares/rectangles... I could MAYBE help-with. That "indented corner" probably makes this challenge too difficult for my simpleton brain. But, I will keep thinking and looking thru my list of playgrounds. I have a strange personal issue (what's new?). It seems my brain can't code anything... until them soccer kids are removed from that cave. hmm. Sorry to hear about your internet issues, DB. First time I have ever heard about heat causing internet problems. Sucks, but interesting. I bet the ISP(s) is/are getting tons of complaints. tham_kathy 1 Quote Link to comment Share on other sites More sharing options...
babbleon Posted July 9, 2018 Share Posted July 9, 2018 Here's a PG that has a 'roof' added: http://www.babylonjs-playground.com/#4GBWI5#90 However, depending where you are in the world, a roof could be one of many types; flat, pitched, hipped etc. dbawel and tham_kathy 2 Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 9, 2018 Share Posted July 9, 2018 This topic is worth a read tham_kathy 1 Quote Link to comment Share on other sites More sharing options...
tham_kathy Posted July 10, 2018 Author Share Posted July 10, 2018 Thanks a lot guys..!!! I really appreciate this..!!! ? GameMonetize 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.