Topic: coords to world position

Hey Alax,

In my game, I need to detect distance between player marker and other marker. Also I need to draw a circle to around player marker.

So I either have to translate real world markers distance to 3D world distance,  or translate coords to 3D world position to perform calculation.
However I cannot find any api to get those done.

Can you let me know how could I do those?
Thanks,

Alax

Re: coords to world position

Hello.

OnlineMapsUtils.DistanceBetweenPoints:
http://infinity-code.com/doxygen/online … bc84a165f2

Example:
http://infinity-code.com/atlas/online-m … ample.html

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: coords to world position

Hey, Alex,
Thanks for your example.

Do you mean tile position is the position of maker in 3D world space?

4 (edited by roronoazaoxl 2015-11-02 14:43:05)

Re: coords to world position

After I read google document and try a example, I think you didnt get what I mean.

        GameObject targetGo = ((OnlineMapsMarker3D)target).instance.gameObject;
        GameObject playerGo = ((OnlineMapsMarker3D)player).instance.gameObject;

        Debug.Log(Vector3.Distance(targetGo.transform.position, playerGo.transform.position));


        Vector2 markerTile = OnlineMapsUtils.LatLongToTilef(target.position, OnlineMaps.instance.zoom);
        Vector2 playerTile = OnlineMapsUtils.LatLongToTilef(player.position, OnlineMaps.instance.zoom);

        Debug.Log(Vector2.Distance(markerTile, playerTile));

the output is: 15.20264 and 0.05957031

lets take ingress as an example:

I want to draw a circle around player and its radius is 500m in real world so player can attack enemy in this range.
How should I project this 500m in the 3D game space? In other world what is the radius of that circle in game space?

Post's attachments

Attachment icon unnamed.png 97.34 kb, 117 downloads since 2015-11-02 

Re: coords to world position

Hello.

Example attached.

Post's attachments

Attachment icon DrawCircleWithRadius.cs 931 b, 173 downloads since 2015-11-02 

Attachment icon img1.png 1.11 mb, 118 downloads since 2015-11-02 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: coords to world position

Thanks alex.

Although I still don't know why, but I think I get the right output. I can figure out myself.