Hello, I loaded a gltf house model in threejs. The house has walls, what i want to know is what direction the exterior wall face is pointing. For example i have a 4 walled house, i want to know which direction the front of the house is facing. Does anyone know how to do this?
Are you looking for the coordinates, or just to know which axis the walls are facing?
https://threejs.org/docs/index.html?q=Helper#api/en/helpers/ArrowHelper
https://threejs.org/docs/#api/en/helpers/AxesHelper
i want to know which axis the walls are facing, either x, -x, z, or -z. I dont care about special walls for now. just straight walls.
Try using axes helper:
https://threejs.org/docs/?q=helper#api/en/helpers/AxesHelper
As @iHast mentioned the axes helper is an important tool to start using very easy to turn on and off in your code.
yah sorry i did not mention, I am already using axes helper, im just wondering if I could figure out which axis the exterior is facing by looking at the mesh data, like the geometry.
I am trying to make a class for the wall, and I want to have a way to calculate which axis the exterior part of the wall points. Do you get what im trying to say?
If the walls do not have thickness (are just planes), you could get each walls face normal quite easily, if they do have thickness this is a little more tricky, you could cast some rays inward from an imaginary circle around the structure and determine wall face sets, grouping each intersections face normal (if they are roughly or exactly the same under some threshold) however these are just basic suggestions based on your original question.