Select to view content in your preferred language

World position to unity position (from geographical coordinates)

3037
10
Jump to solution
11-02-2022 08:29 AM
ReintJ
by
Occasional Contributor

Hello,

I am trying to get the Unity position from geographical coordinates, I have the following code to get the HPTransform position, but I am not sure how to continue from here, (I'm not sure if this is even possible),

 

 

double3 worldPos = map.View.GeographicToWorld(new ArcGISPoint(x, y, spatialRef));

 

 

map = the ArcGISMapComponent; spatialRef = new ArcGISSpatialReference(4326); x,y = 5.1 & 52.1 (example)

This results in: worldPos = double3(568832.151913682, 0, 6816306.77166522)

I have looked a bit in to the HPTransform code, but I couldn't figure out how it worked.

Some more details about the project: I do not use the rebase component on the ArcGISCamera & and the ArcGISCamera is on a fixed location, and I'm using a local scene.

Thanks for the help,

Kind regards,

Reint.

 

 

 

0 Kudos
10 Replies
m_d
by
Emerging Contributor

I think there's a way to find it programmatically. But I just set it up as a serialized field so I could choose it in the IDE: 

[SerializeField]
private ArcGISMapComponent _arcGisMapComponent;

0 Kudos