Jump to content

How can I create a roof on top of a footprint in babylon js?


Recommended Posts

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.  :)

Link to comment
Share on other sites


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?


Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...