# Wall Creation on given just 2 points

## Recommended Posts

I have a problem in plotting points when trying to create WALLS.

The problem in dissection :

- I have 4 points in XOZ plane That I want them to produce 4 walls, as each 2 points are a line and I want each line to become a wall by computing the other 2 points of the wall. I assume the height of the wall (3 meters, for example).

This wall might contain holes later (Doors & Windows).

Finally I need an enclosed room. I want to create these walls without importing from blender, I get those points from elsewhere.

Here is the steps, I use to solve the problem:

1) I split the array into 4 lines. Each line contains 2 points.

2) I have to compute the 2 other points for each line. and here is the problem. I used the dimension Y which is wrong when using ExtrudedPolygon Object. So I have to work in the same XOZ plane and rotate. Here I face other problems like How to calculate the angle of rotation? plus the way of computing the 2 other points will be through having 2 data : The length of the wall (3 meter for example) and the angle which is also a variable that depends on the slope of our line.

Here is a sample of my try:

You can find that in the last loop, I create a wall but with points that contain a Y dimension, which resulted in corrupted shape, But I hope to avoid the suffering of Computing the other 2 points in the same XOZ plane which enforces me to respect the slope of the line and so on as I illustrated in the second point.

If you have any alternative ideas, I welcome that. Thanks in advance.

Ping @JohnK

##### Share on other sites

Having a busy few days. Will have a closer look tomorrow given half a chance .

In the mean time does this help http://babylonjsguide.github.io/gamelets/House

##### Share on other sites

@JohnK Thank you very much. The article you have provided me with helped me a lot. I have plotted the points very well and the result is perfect. Thanks for your time. I appreciate that.

## 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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.