Jump to content

Hole in Mesh


Recommended Posts


I'm new in BabylonJs and I try to modelize an house with an hole as door. 

I create my house Mesh with the ExtrudeShape shape function and now my problem is to create the door. I substract a box with the CSG function but it does not do a complete hole, only the shape of the box.

I did a playground with my current progression. http://www.babylonjs-playground.com/#1MR5CY

Is my project is possible ?

Link to comment
Share on other sites

@sailor: Welcome to the forum :)

My guess is that you do not have an inside to the house. See attached image A. So when you use CSG it just cuts a depression when applied to just one edge of the mesh.

Image B has an inside an an outside to the mesh and the cutting mesh goes through both - you see an inside and an outside.

cheers, gryff :)


Link to comment
Share on other sites

I tried this too. There is a problem if you want to use physics. You have to generate your own physicsImposter if the player sould collide against the walls. If you use one physicsImposter for the result CSG, then the player cant enter the house because the physicsImposter (Box, Circle, any) will go throught the whole house. To prevent this you have to generate more physicsImposters. Than you can create the walls one by one too.

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