Skip to content

Commit

Permalink
Add support for vlowres, lowres and medres.
Browse files Browse the repository at this point in the history
Resolves #4.
  • Loading branch information
leMaik committed May 14, 2017
1 parent cac64b8 commit 156a157
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ The maps can be configured by adding options to the map's section in the `world.
| `chunkPadding` | Radius of additional chunks to be loaded around each chunk that is required to render a tile of the map. This can be used to reduce artifacts caused by shadows and reflections. | 0 |

## Ceveats
* Rendering maps with a `..._lowres` perspective doesn't work at the moment. As a workaround, change the perspective to `..._hires`.
* Rendering is pretty slow, but I'll improve this by rendering multiple tiles as one image in the future.
* ChunkyMap, at the moment, only works with Bukkit/Spigot. Supporting more servers would be awesome, though!
* ChunkyMap only works with Bukkit/Spigot at the moment. Supporting more servers would be awesome, though!

## Dynmaps that use this plugin
* Craften Server: [Lobby dynmap](https://play.craften.de/maps/index.html?worldname=world&mapname=rs&zoom=5&x=594&y=64&z=-420)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public DynmapCameraAdapter(IsoHDPerspective perspective) {
public void apply(Camera camera, int tx, int ty, int mapzoomout) {
double x = tx + 0.5;
double y = ty + 0.5;
Vector3D v = new Vector3D(x * (1 << mapzoomout), y * (1 << mapzoomout), 65);
Vector3D v = new Vector3D(x * (1 << mapzoomout) * 16 / perspective.getScale(), y * (1 << mapzoomout) * 16 / perspective.getScale(), 65);
transform.transform(v);

camera.setProjectionMode(ProjectionMode.PARALLEL);
camera.setPosition(new Vector3(v.x, v.y, v.z));
camera.setView((90 - perspective.azimuth + 90) / 180 * Math.PI, (-90 + perspective.inclination) / 180 * Math.PI, 0);
camera.setFoV(8.0);
camera.setFoV(128 / perspective.getScale());
camera.setDof(Double.POSITIVE_INFINITY);
}
}

0 comments on commit 156a157

Please sign in to comment.