Theres an example of something existing:
I tried to replicate this:
I know that the diameter for that ship's circle is
6 blocks (as u the circle is overlapping the edges of the 6ths blocks, which also counts).
I know that the size of the isometric tile is
So I replicated that, and that's the output I get:
You can see a few problems:
- The size of the ellipse is not the same, even though I use the provided size information.
- Even if the size is the same, the edges does not end at the same locations, as in the provided image.
There's my implementation, I am sure I have done the math wrong, as usual:
// The vessel radius (diameter / 2) int radious = vessel.getInfluenceRadius(); renderer.begin(ShapeRenderer.ShapeType.Line); renderer.setColor(Color.RED); // Calculate the size of the ellipse int width = radious * GameTile.TILE_WIDTH; int height = radious * GameTile.TILE_HEIGHT; // Draw ellipse, centered around vessel where xx and yy is where the vessel starts drawing renderer.ellipse(xx - width / 2 + vessel.getRegionWidth() / 2, yy - height / 2 + vessel.getRegionHeight() / 2, width, height); renderer.end();
What did I do wrong in the calculation? You can see that the ship in the real preview covers 29 blocks (including the small corners on north/south/west/east, and my preview only covers .. like 13.