Topic: Nomenclature on scenes

Hello Alex,

How do we put shape file or osm data of nomenclature in to the scene. 

Regards
Jai

Re: Nomenclature on scenes

Hello.

It depends on the complexity of the shape.
If the shape is relatively simple, just draw it using a line or polygon.
If the shape is complex, you need to rasterize it, divide it into tiles (for example using MapTiler), and use it as overlay.
http://infinity-code.com/atlas/online-m … ample.html

Kind Regards,
Infinity Code Team

Re: Nomenclature on scenes

Hello Alex,
Here I want to overly  building  names over buildings

Re: Nomenclature on scenes

If you mean buildings painted in tiles, then most likely you'd better use overlay.
If you mean 3D buildings, use TextMesh.
https://docs.unity3d.com/ScriptReference/TextMesh.html

Kind Regards,
Infinity Code Team

Re: Nomenclature on scenes

I mean to say that suppose we have osm file of buildings . now i want to put labels on building using information available in osm file ; how to do that in RWT?

Re: Nomenclature on scenes

Oops. I for some reason thought that you are asking about Online Maps.

Do you want to show labels runtime or in the scene view?

Kind Regards,
Infinity Code Team

Re: Nomenclature on scenes

Yes. Labels for building or places.

Re: Nomenclature on scenes

I asked you about something else:
Do you want to show labels runtime or in the scene view?

Kind Regards,
Infinity Code Team

Re: Nomenclature on scenes

Runtime

Re: Nomenclature on scenes

Something like that:

using System.Linq;
using InfinityCode.RealWorldTerrain.OSM;
using UnityEngine;

public class ShowBiuldingAddress : MonoBehaviour
{
    public float yOffset = 40;
    public Font font;
    public int fontSize= 16;
    private GameObject textGO;

    private void Start ()
    {
        RealWorldTerrainOSMMeta meta = GetComponent<RealWorldTerrainOSMMeta>();
        if (meta == null || font == null)
        {
            Destroy(this);
            return;
        }

        RealWorldTerrainOSMMetaTag nameTag = meta.metaInfo.FirstOrDefault(m => m.title == "name");
        if (nameTag == null)
        {
            Destroy(this);
            return;
        }

        textGO = new GameObject("Text");
        textGO.transform.SetParent(transform, false);
        textGO.transform.localPosition += new Vector3(0, yOffset, 0);
        TextMesh textMesh = textGO.AddComponent<TextMesh>();
        textMesh.alignment = TextAlignment.Center;
        textMesh.anchor = TextAnchor.MiddleCenter;
        textMesh.font = font;
        textMesh.fontSize = fontSize;
        textMesh.text = nameTag.info;
    }

    private void Update()
    {
        textGO.transform.LookAt(Camera.main.transform);
        textGO.transform.Rotate(Vector3.up, 180);
    }
}
Kind Regards,
Infinity Code Team

Re: Nomenclature on scenes

Should  I attach this script on building post processing??  Sorry,  m very new to unity

Re: Nomenclature on scenes

You need to attach this script to every building for which you want to display labels.

Kind Regards,
Infinity Code Team

13 (edited by jaisingla 2018-09-18 12:46:20)

Re: Nomenclature on scenes

I have tried but it says script can not be attached due to monobehavior etc.

Similarly we want labels for place names too.

Re: Nomenclature on scenes

Honestly, I do not even know what to say.
Here's a video of how to create and use scripts:
https://www.youtube.com/watch?v=XsyS4ANO0sE

Kind Regards,
Infinity Code Team