hello, everyone! I have some trouble with my scripts for Unity using.
I wrote a script to convert the latitude and longitude of ArcGIS Map into Unity world coordinates. My code is as follows.
But when I was debugging, the following message appeared in my console of Unity.
Latitude and longitude what my inputting are as follows.
I am troubled by the above problems, if someone has such a problem to solve the idea can give me a message?
Thanks for the help,
Kind regards,
Tung.
ArcGISMapComponent globe = ...
var root = globe.gameObject.GetComponent<HPRoot>();
var view = globe.View;
double latitude = ...
double longitude = ...
double altitude = ...
ArcGISPoint geodLoc = new ArcGISPoint(longitude, latitude, altitude, ArcGISSpatialReference.WGS84())
double3 worldLoc = view.GeographicToWorld(geodLoc);
Vector3 universeLoc = (float3)root.TransformPoint(worldLoc);
The universeLoc is the position within the unity scene.
Be aware that the longitude is the first argument of ArcGISPoint.