bws Posted September 5, 2015 Share Posted September 5, 2015 Hi, Just wanting some guidance here... I'm new to 3D Web development and Babylon I'm wanting to create a 'room' with objects in it with the arc camera. The room is shaped as a simple 3D rectangle (as you would expect a room to be). When the user looks at the room from a short distance, I'm wanting the walls to be transparent (so the user can see inside the room), however the walls at the very back to be visible.When the camera spins around the room (180 degrees for example), the same thing is to apply. Similarly with the floor and the roof by moving up and down. How can I achieve this? I was thinking of creating the 6 'planes' manually, and then using some maths to set the transparency of each plane individually depending on where the camera is positioned (is this even possible?).Or, is there a type of Mesh best suited to do this? Do i need to turn back culling off? I wasn't able to find anything on this hence my question. Any help would be greatly appreciated.... Thanks,bws. Quote Link to comment Share on other sites More sharing options...
Convergence Posted September 5, 2015 Share Posted September 5, 2015 Flipping the normals on a Box, and leaving backFaceCulling on should have the desired effect (but I wouldn't know a function off the top of my head that does that in babylon js). Quote Link to comment Share on other sites More sharing options...
bws Posted September 5, 2015 Author Share Posted September 5, 2015 Oh thanks! I only just solved this myself by simply setting the sideOrientation parameter to BABYLON.Mesh.BACKSIDE. In other words, instead ofvar box = BABYLON.Mesh.CreateBox("box", 10.0, scene);you putvar box = BABYLON.Mesh.CreateBox("box", 10.0, scene, false, BABYLON.Mesh.BACKSIDE );It was exactly what I was after. Thank-you for your response Convergence. Convergence and Ahiru 2 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.