RealWorldTerrain

因为项目需要真实地形,所以使用了这款插件,感觉很强大,这里我用的的是版本3.8的.翻看的他的文档感觉很牛逼,它能够跟多款插件结合使用  比如:Volume Grass(草坪插件),  Playmaker,  EasyRoads 3 d v3(地图道路),   Online Maps,  BuildR(生成地图建筑插件).

你也可以使用它内置的建筑生成器,本篇文章主要讲到我们用到的一些脚本,使用方法网上也同样很多就不再讲了,

图片数据提供者自我感觉ARCGIS的效果很不错,Bing地图资源图片真的很一般不知道为什么

RealWorldTerrainOSMMeta :该类包含有关建筑物的元信息  地图上下载的信息以及你也可以自己加一些属性信息

RealWorldTerrainContainer: 该类它包含有关地形的所有信息,经纬度范围,树木距离,地形图片信息,以及将世界坐标转换为地理坐标的方法,他继承自抽象类RealWorldTerrainMonoBase

using InfinityCode.RealWorldTerrain;
using System;
using System.Collections.Generic;
using UnityEngine;

public class Texts : MonoBehaviour
{
    public RealWorldTerrainContainer _item;
    public Transform _game;
    public Vector2 longitudeAndlatitude = Vector2.zero;
    public Vector3 WorldPosition = Vector3.zero;
    
    // Use this for initialization
    void Start()
    {
        _item.GetCoordinatesByWorldPosition(_game.position, out longitudeAndlatitude); //物体经纬度     
        Debug.Log(longitudeAndlatitude);
        _item.GetWorldPosition(100.1694, 25.69965, out WorldPosition);//世界坐标
        Debug.Log(WorldPosition);
    }

    // Update is called once per frame
    void Update()
    {

    }
}

 

这是插件自己生成的一些建筑,树木,道路和草坪,后期你自己也可以在在此基础上增加一些建筑或者其他

 

相关推荐
WorldComposer includes a shadow removal tool, that makes it unique compared to other software. There are always shadows on satellite images and if used in a game or simulation it forces a fixed sun position to match with the shadows. Also shadows in satellite images are almost completely black which doesn’t make them look good. WorldComposer solves this by removing shadows with it’s shadow removal algorithm, which will not only make the satellite images look way better, but also allows you to have fully day and night cycles. WorldComposer is designed like google maps with a scrolling and zooming functionality from real World satellite imagery directly into Unity. You can create multiple areas that display the real size in kilometers, and they can be exported with a few clicks of a button. Then for each exported area you can create the terrains with a click of one button directly in your Unity Scene. Satellite images can be exported to zoom level 19 which is 0.3 meter per pixel resolution. Elevation data can be exported up to zoom level 14, which is 10 meter per pixel resolution. WorldComposer only exports elevation heightmaps and satellite images, with itself you can create awesome looking real World terrain. But in combination with TerrainComposer you can mix the or alter the heightmaps or add perlin noise to enhance the detail, mix the satellite images with splat textures, add cloud shadows, etc. Also you can place trees,grass and objects and do the unlimited tweak and editing TerrainComposer offers to push the quality to unseen limits!
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页