Jump to content

Questions on "Building house from floor plan".

Recommended Posts


First of all,  hats off to these classes and work. 🙏

I am referring the example here. https://www.babylonjs-playground.com/#1Z71FW#9

I have a few questions.

1. When I move camera to a point inside the house and look at the ceiling, I don't see any roof. Why?  

2. How to add a floor? One solution is: Setting a height of a plain roof to zero will become a floor. Will it be OK to do so? I did so but the floor is not visible when I move camera to a point inside the house.

3. How to set texture to individual walls?  


Can you please answer? I know that these samples intended to demonstrate the capabilities of building meshes at run-time but I would like to know answers for the questions. This will be a complete solution if we can set texture to individual walls and floors.

Thanks in advance.





Link to post
Share on other sites

1. It might be due to clipping if you are to close from an object ( dist < minZ ) or due to culling (faces are intented to usually be visible from one side to improve perf)

2. It would be ok but either clipping or face culling might prevent it to be visible.

3. You need to use a proper uv setup for this: https://en.wikipedia.org/wiki/UV_mapping


Link to post
Share on other sites

1. (a) Because there is a black ceiling (black because (i) no material applied to ceiling, (ii) light does not reach ceiling) Ceiling constructed on line 848 in this PG#9 and PG#21 but 849 in this PG https://www.babylonjs-playground.com/#1Z71FW#22 with added color and light

1. (b) If you remove the ceiling (comment out line 848) then you can see the inner roof provided you set its backFaceCulling to false as in  https://www.babylonjs-playground.com/#1Z71FW#21

2? Floor already there?

3. as Sebavan says it is down to the uv setup which currently uses a texture map of two images for the exterior walls and interior walls see line (816 or 817) and uv values calculated so that the textures appear at the same scale on each wall. By using more images in the texture map it would be possible to apply different areas of the image to different walls. An alternative would be to build the interior walls as separate and individual polygon meshes kept together by a mutual parent and each with its own material. You could do something similar with the exterior walls and then you could have different textures on different exterior walls. More on uvs at https://doc.babylonjs.com/how_to/custom#texture

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