tham_kathy

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.