[core, node] Support axonometric rendering

This commit is contained in:
Lauren Budorick
2017-10-14 03:15:34 +02:00
committed by GitHub
parent 98bb8613c3
commit e43e2aa3d7
12 changed files with 176 additions and 2 deletions

View File

@@ -66,6 +66,15 @@ void TransformState::getProjMatrix(mat4& projMatrix, uint16_t nearZ) const {
matrix::translate(projMatrix, projMatrix, pixel_x() - size.width / 2.0f,
pixel_y() - size.height / 2.0f, 0);
if (axonometric) {
// mat[11] controls perspective
projMatrix[11] = 0;
// mat[8], mat[9] control x-skew, y-skew
projMatrix[8] = xSkew;
projMatrix[9] = ySkew;
}
matrix::scale(projMatrix, projMatrix, 1, 1,
1.0 / Projection::getMetersPerPixelAtLatitude(getLatLng(LatLng::Unwrapped).latitude(), getZoom()));
}