title: Suggestion on how to create a window over a wall
body: <p>I am working on a three.js application where I have to create a building structure  (all on ground floor), the height, width, length will be specified by user. User can change wall and roof color (which are applied using texture, as I have images for each color with some texture). They can also add any accessory on a selected wall (like a window or a door), which can be then dragged and dropped on that same selected wall. After deciding where they want to put the window (for eg.) they will click a button to confirm the position. Now I have to create a window in the wall, so that I can see inside of the room. Please suggest your views on following approaches:</p>
  
  <p>Once the user confirms the position of the door -</p>
  
  <p>a.) I can add the mesh of the window in the main building mesh <code>mainMesh.add(windowMesh);</code>. But the problem is even if I set the transparent material to the window , the wall material still shows.</p>
  
  <p>b.) I can subtract the window mesh from the main building mesh (using CSG, threeCSG) <code>buildingmeshcsg.subtract(windowmeshcsg)</code> which creates a hole in the building mesh, and then I put the window mesh over that hole. Now the problem is after any CSG operation the faces of the original geometry gets all mixed up, so after the csg operation, the color, UV of faces goes away.</p>
  
  <p>c.) I can create wall in small sections, 
  <a href="https://i.stack.imgur.com/2EV79.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2EV79.png" alt="wall in sections"></a>
  like from one corner to window corners then,  from another window corner to another wall corner. But this messes up the texture I have applied on walls, because I have created UV for front and back walls, as the texture was not applying correctly.</p>
  
  <p>Please suggest your views.</p>
  
  <p>Have to make something like this :<a href="https://forum.unity.com/threads/make-a-seethrough-window-without-making-hole-in-the-wall.286393/" rel="nofollow noreferrer">https://forum.unity.com/threads/make-a-seethrough-window-without-making-hole-in-the-wall.286393/</a></p>