Topic: Nomenclature on scenes
Hello Alex,
How do we put shape file or osm data of nomenclature in to the scene.
Regards
Jai
You are not logged in. Please login or register.
Infinity Code Forum → Feature Requests → Nomenclature on scenes
Hello Alex,
How do we put shape file or osm data of nomenclature in to the scene.
Regards
Jai
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
Hello Alex,
Here I want to overly building names over buildings
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
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?
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?
Yes. Labels for building or places.
I asked you about something else:
Do you want to show labels runtime or in the scene view?
Runtime
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);
}
}
Should I attach this script on building post processing?? Sorry, m very new to unity
You need to attach this script to every building for which you want to display labels.
I have tried but it says script can not be attached due to monobehavior etc.
Similarly we want labels for place names too.
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
Infinity Code Forum → Feature Requests → Nomenclature on scenes
Powered by PunBB, supported by Informer Technologies, Inc.