oschakravarthi Posted November 30, 2018 Share Posted November 30, 2018 Hi, 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. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 30, 2018 Share Posted November 30, 2018 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 Quote Link to comment Share on other sites More sharing options...
JohnK Posted November 30, 2018 Share Posted November 30, 2018 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.