• Content Count

  • Joined

  • Last visited

About tham_kathy

  • Rank
  • Birthday October 7

Profile Information

  • Gender

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Actually I understood everything clearly except that UV thing. So I just removed that code from my research project and now there is no texture for the roof. 😁 Thanks for the help @Wingnut You guys really helped me during my research project. Thanks again.
  2. @JohnK Can you explain this bit more if you don't mind ?
  3. Can anyone please explain the code here? I'm really confused with the complex formulas here. Went through the code for days but couldn't understand it properly. Really appreciate this help. example -> Thanks
  4. One last thing; What is the purpose of using indices array? for(var w = 0; w <nbWalls; w++) { indices.push(w, (w + 1) % nbWalls, nbWalls + (w + 1) % nbWalls, w, nbWalls + (w + 1) % nbWalls, w + nbWalls); // base indices } currentLength = indices.length; for(var i = 0; i <currentLength/3; i++) { indices.push(indices[3*i + 2] + 2*nbWalls, indices[3*i + 1] + 2*nbWalls, indices[3*i] + 2*nbWalls ); // top indices } for(var w = 0; w <nbWalls; w++) { indices.push(w, w + 2 *nbWalls, (w + 1) % nbWalls + 2*nbWalls, w, (w + 1) % nbWalls + 2*nbWalls, (w + 1) % nbWalls); // inner wall indices indices.push((w + 1) % nbWalls + 3*nbWalls, w + 3 *nbWalls, w + nbWalls, (w + 1) % nbWalls + nbWalls, (w + 1) % nbWalls + 3*nbWalls, w + nbWalls); // outer wall indices } And what does this mean? Thanks
  5. Question is regarding example I don't understand how outer walls and footprint is created. I'm confused with the below code and can anyone please explain the below code step by step? Thanks for(var w = 0; w <= nbWalls; w++) { angle = Math.acos(BABYLON.Vector3.Dot(line, nextLine)/(line.length() * nextLine.length())); direction = BABYLON.Vector3.Cross(nextLine, line).normalize().y; lineNormal = new BABYLON.Vector3(line.z, 0, -1 * line.x).normalize(); line.normalize(); outerData[(w + 1) % nbWalls] = walls[(w + 1) % nbWalls].corner.add(lineNormal.scale(ply)).add(line.scale(direction * ply/Math.tan(angle/2))); line = nextLine.clone(); walls[(w + 3) % nbWalls].corner.subtractToRef(walls[(w + 2) % nbWalls].corner, nextLine); }
  6. @JohnK What about planes that have labels more than 4? Below is the roofprint that I'm trying. One plane has 6 labels so it's not creating . Any solution? This is the code -> (Zoom out if you can't see anything)
  7. I'm creating roofs for a given house shape at runtime using straight skeleton of the shape. And for that I really appreciate your help.! Thanks for everything
  8. @JohnK I tried your code above.When I play the scene, the roof is created. But when I rotate, some parts of the roof are dissapearing. Below is my html file. (I'm uploading my html file cuz I don't know how to create a playground.) index.html
  9. 🤜@JohnK Thanks a looot.. 🙏 U saved my life 😁😁
  10. @JohnK Actually what I'm doing is creating houses at run time by reading the given floor plan. I get an array of coordinates by reading the floor plan and I'm passing the array values to the buildFromPlan method. I don't find any method which I can used to automate this process for the number of rooms. If I use your suggestion, I have no idea how give values for the positions. Anyway, thanks a lot.!
  11. This is what I get when I substract 2 rooms. Or is there a way to hide the lines that separate two rooms? Or is it possible to merge those two meshes from 0.5cm without changing their original positions? Then there will be only one wall in between two rooms. I'm very new to this 3D stuff so plz help me to find a solution
  12. I tried with different uv values but the texture is not appearing as it is. The way I calculated uv values is; var uvs = []; for(var p = 0; p < positions.length / 3; p++) { uvs.push((positions[3 * p] - (-4)) / 6, (positions[3 * p + 1] - (-4)) / 8); } Can you please suggest me a way to apply the texture as it is for both outer walls and inner walls separately?