Is the provided hexagon really perfect?

Im very confused with this new hexagon grid tiles. The tiles really dont look like every angle between its sides is what it should be… After comparing it to other images of hexagons, I realised im right, it doenst match by a perceivable margin. The image is stretch on the width.

Is this intentional so the math on calculating world pos would not involve irrational numbers or something like that? Or maybe its just an accident?

I dont know, the grid in game works perfectly, but I wanted to calculate some angles to place some perfectly diagonal walls, and make a hexagon wall to perfectly fit a grid, and it didnt work.

I think this is the reason.

I attach some images to show my problem:

The hexagon sprite provided in this course (transparent) with some hexagon grid image on the background. I promise I did not stretch any of the images vertically or horizontally.
image


Cylinder from the prototype pack, see how with the dimenstions fixed in X = 2 and Z = 2 it doesnt match.


If I stretch it on the X to 1.5, then it does match perfectly (I needed to add a parent because the cilinder is rotated, and needed to stretch it on world X)

So my final question is. Why is the image stretched on the width? Is that intentional? How could I fix it, what calculations on the grid system script should I change for that fix to work?

Thanks :smiley:

1 Like

Yeah the word “perfect” is a bit tricky because there are two types of perfect Hexes.

You have a Hex where all the angles are perfectly 60º
And you have a Hex where it’s perfectly dimensioned in a square shape, which is what I used.

So it is perfect in the sense that the top right and top left points are exactly pixel perfect at quarter height, but it’s not perfect in the sense that all the angles at 60º.
Compared to a perfect 60º hex, the one in the course is slightly squished to make width = height whereas a perfect 60º hex is more pointy.

If you want to use a perfect 60º hex you can use that, just need to change the calculations for positioning the hexes.

1 Like

Ohh this makes sense. I didnt know there were two ways of thinking of this.

Do you have the number on exactly what is the difference in width between one and the other? That would allow me to insert that number into the calculations.

Thanks :smiley:

This page was really helpful to me when researching Hexagons Hexagonal Grids

So for that type of hexagon you have a size then height = size * 2 and width = sqrt(3) * size

3 Likes

Very clear, thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms