Skip to content

Coordinates

Martin Jakobsson edited this page Jun 3, 2019 · 3 revisions

There are several different kinds of coordinates in Hexacraft.

Some coordinates are used to refer to blocks, and others to refer to any position in the world.

(Illustrative images will come soon)

Blocks

For more information about how blocks are grouped into chunks, see Chunks

World coordinates

The main way to reference a block is by it's world coordinates. Let's call these (x, y, z). Since the cylinder only has a finite circumference the z coordinate can only have the values in [0, (size-1)], where size is the circumference of the cylinder.

Since the blocks are hexagonal, the neighbors of a block are a bit different to normal.

One note about this coordinate system is that it is skewed. This means that the x- and z-coordinates are not at right angles. In particular the x-axis is not only pointing along the cylinder, but also slightly around it.

Any position

Cylinder coordinates

The cylinder coordinates of an object is (x, y, z) where z goes around the cylinder, x along the cylidner, and y goes out of the cylinder. This is the standard way to reference a position.

One important identity for cylinder coordinates is that if you walk in the z-direction you will end up where you started. This is not true for some other coordinate types since they are skewed.

Normal coordinates

These are the coordinates used by e.g. renderers. All other kinds of coordinates pretend that the world is flat, and transforming them into normal coordinates warps the world onto the strange cylinder that the world is.

How it works

Clone this wiki locally