Stef
Stef

Reputation: 325

MapControl.ActualCamera doesn't seem to always contain correct data

I'm working on a UWP project where I render 3D content on top of a tilted BingMaps map.

I'm rendering my 3d content using directx in a seperate (partially transparent) control that lies on top of the map. So it's not rendered within or as part of the mapcontrol or anything, it's completely seperate.

I made methods that transfer the geo/gps coordinates to the 3d coordinate system I use in Directx, and I make the camera in directx match the map's camera.

But the problem is, the camera data I retrieve from the mapcontrol doesn't always seem to be correct, or at least not up to date.

I use these properties: MapControl.ActualCamera.Location.Position, MapControl.Center.Location.Position, and MapControl.ActualCamera.FieldOfView.

Are these perhaps not the best ones to get the actual current camera data? If so, which ones should I use?

Upvotes: 0

Views: 82

Answers (1)

Duncan Lawler
Duncan Lawler

Reputation: 1772

The camera object isn't currently defined to allow you to completely replicate the full projection matrix used, so I don't think you'll be able to render 3D content that completely matches. Aerial and Road mode use different projections (Mercator plane vs. Globe) and you can't reconstruct the camera look-at vector from the center location property without knowing the map projection and terrain surface values.

Upvotes: 0

Related Questions