# Map terrain make equilateral triangle

Status
Not open for further replies.

Level 12
How would I go about making an equilateral* triangle shaped map? (Triangle with all three sides the same length.)

Although it wouldn't be perfect because of squares, an equilateral triangle shape-esque that's symmetrical.

I could use functions in game but it won't really help me while in the editor...

Normally while painting you'd make two circles and use the two points where they intersect but since the triangle would be the size of the map I would have needed to go far out of map bounds while making it. ._.

#### Flux

Level 22
since the triangle would be the size of the map I would have needed to go far out of map bounds while making it. ._.

I guess you just have to make the triangle smaller to fit the map.

Something like this to maximize the space of the map.

But if you want symmetrical,

#### SAUS

Level 12
All angles in an equilateral triangle are 60 degrees.

First get 60 degrees in radians:
pi / 180 * 60 = 1.0471975512

Then let's get sine of that:
sin(1.0471975512) = 0.86602540378

If you multiply this number by the amount of tiles you use on the flat side, that is how far the angled lines should go (EX 100 tiles across means 86.6 tiles perpendicular to that - you'd have to round).

Next, we need to know how to make the angled lines. Calculate the slope of the sides (need to reach the max height):
0.86602540378 (Tiles across) / (Tiles across / 2)
= 0.86602540378 * 2 (more simple than I thought haha)
= 1.73205080756

We obviously can't go 1.732 tiles, so we should find a multiple that is close to a whole number:
4 * 1.732 = 6.928

This is pretty close, but basically, if you go up by 6.928 (round to 7) tiles for every 4 tiles across from each side, they should meet at the top and make an equilateral triangle.

I hope my math was not wrong...

Level 12
I guess you just have to make the triangle smaller to fit the map.

Something like this to maximize the space of the map.

But if you want symmetrical,

Honestly I would prefer to make it like in your first image, but I figured that it would be more difficult or maybe not even possible to make it equal for each side and corner.

Also my actual question was how I would make it so it's as close to equal as possible, I know the shape so I don't really need to a see a picture of it, how would I know how to "draw" the initial out lines as accurate as the editor will allow?

This is pretty close, but basically, if you go up by 6.928 (round to 7) tiles for every 4 tiles across from each side, they should meet at the top and make an equilateral triangle..

Ok, thanks I'll try that and see what happens.

#### Flux

Level 22
Also my actual question was how I would make it so it's as close to equal as possible, I know the shape so I don't really need to a see a picture of it, how would I know how to "draw" the initial out lines as accurate as the editor will allow?

The Square tiles of the Editor limits you to make a perfect straight equilateral triangle. You can however make the distance between the three points almost equal using distance formula (& xy coordinates in WE). Then you can use a trigger function that takes the distance between 2 points to check if they have equal distance. Once you have all three points in position, just make a path that connects them but note that it will not be a perfect diagonal.

Edit: If you want to make the 1st photo, it has an angle of 15 degrees with the horizontal axis.

#### Dr Super Good

Spell Reviewer
Level 63
You convert an image taken of a vector triangle into a w3e file.

Similar to what I did here for an image.

Filling of a triangle is a common computer operation used tens of thousands of times every frame of a game that gets rendered.

Level 12
You convert an image taken of a vector triangle into a w3e file.

Similar to what I did here for an image.

Filling of a triangle is a common computer operation used tens of thousands of times every frame of a game that gets rendered.

So in short you can convert any image into terrain in the world editor?

I tried searching for it but I haven't found any information about this so far, could you explain a bit how one would go about to convert an image into terrain? unless I misunderstood what you've said.

#### Dr Super Good

Spell Reviewer
Level 63
So in short you can convert any image into terrain in the world editor?

I tried searching for it but I haven't found any information about this so far, could you explain a bit how one would go about to convert an image into terrain? unless I misunderstood what you've said.
In the case of the example shown I used my JAVA .w3e interface, JAVA's imaging framework and a hacky adapter which mapped pixels to either ground or water node height. I attached it all together with some code in a main method and ran the program. I then used MPQEdit to put the .w3e file back into a map.

I could send you the mess of code if you wanted. However you do need knowledge of the JAVA programming language to use it.

#### Xonok

Level 21
This tool creates heightmaps out of image files. It's not perfect(doesn't change water heights), but it's quite usable.

Status
Not open for further replies.

Replies
8
Views
1K
Replies
8
Views
1K
Replies
14
Views
1K
Replies
6
Views
982
Replies
0
Views
448