Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add public axonometric (isometric, skew) option #11882

Open
1ec5 opened this issue May 11, 2018 · 3 comments
Open

Add public axonometric (isometric, skew) option #11882

1ec5 opened this issue May 11, 2018 · 3 comments
Labels
Android Mapbox Maps SDK for Android feature gl-ios iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS Tangram parity For feature parity with Tangram ES

Comments

@1ec5
Copy link
Contributor

1ec5 commented May 11, 2018

#10064 implemented an axonometric (isometric) rendering option as an alternative to perspective 3D rendering, but it only exposed the option to node-mapbox-gl-native. Similar to Tangram, it would be nice to expose this option in the map SDKs.

At a glance, it looks like the skew would logically be a property of MGLMapCamera on iOS/macOS. However, it’s currently implemented in mbgl as an option on mbgl::Map. Would it make sense to move the option from mbgl::Map to mbgl::CameraOptions? Would it be feasible to animate the skew simultaneously with other camera options, as that would imply?

/cc @lbud

@1ec5 1ec5 added feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS Android Mapbox Maps SDK for Android Tangram parity For feature parity with Tangram ES labels May 11, 2018
@stale stale bot added the archived Archived because of inactivity label Nov 7, 2018
@stale
Copy link

stale bot commented Nov 29, 2018

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Nov 29, 2018
@julianrex julianrex reopened this Nov 29, 2018
@stale stale bot removed the archived Archived because of inactivity label Nov 29, 2018
astojilj added a commit that referenced this issue May 14, 2019
The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges.

MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation.

iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set.

Tests:
ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests.

Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets.

LocalGlyphRasterizer: verify text rendering when applying padding.

Related to #11882: both use projection matrix elements [8] and [9].

Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area.

Fixes #12107, #12728, navigation-sdks/issues/120
astojilj added a commit that referenced this issue May 28, 2019
The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges.

MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation.

iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set.

Tests:
ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests.

Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets.

LocalGlyphRasterizer: verify text rendering when applying padding.

Related to #11882: both use projection matrix elements [8] and [9].

Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area.

Fixes #12107, #12728, navigation-sdks/issues/120
astojilj added a commit that referenced this issue May 28, 2019
The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges.

MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation.

iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set.

Tests:
ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests.

Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets.

LocalGlyphRasterizer: verify text rendering when applying padding.

Related to #11882: both use projection matrix elements [8] and [9].

Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area.

Fixes #12107, #12728, navigation-sdks/issues/120
@stale stale bot added the archived Archived because of inactivity label May 28, 2019
@stale
Copy link

stale bot commented May 28, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed May 28, 2019
@friedbunny friedbunny reopened this May 28, 2019
@stale stale bot removed the archived Archived because of inactivity label May 28, 2019
@1ec5
Copy link
Contributor Author

1ec5 commented May 28, 2019

#14664 adjusts the map’s focal point to account for content insets by adjusting the projection matrix. These adjustments are currently overridden when using axonometric perspective. This issue is latent because only the Node bindings expose an axonometric perspective option, while only the mobile SDKs expose content inset options. But as soon as we implement the feature requested here, we’ll need to address the overridden projection matrix.

/cc @astojilj

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android feature gl-ios iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS Tangram parity For feature parity with Tangram ES
Projects
None yet
Development

No branches or pull requests

4 participants