package chess.view.DDDrender; import org.joml.Vector2f; import chess.model.Coordinate; class DDDPlacement { public static Vector2f coordinates_to_vector(Coordinate coo) { return coordinates_to_vector(coo.getX(), coo.getY()); } public static Vector2f coordinates_to_vector(float x, float y) { return new Vector2f(1.0f - 0.125f - x * 0.250f, 1.0f - 0.125f - y * 0.250f); } public static Coordinate vector_to_coordinates(Vector2f pos) { int x = (int) ((1.0f - pos.x) * 4.0f); int y = (int) ((1.0f - pos.y) * 4.0f); return new Coordinate(x, y); } }