Find Direction of exterior walls in gltf

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?

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:

As @iHast mentioned the axes helper is an important tool to start using very easy to turn on and off in your code.

1 Like

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.

1 Like