摘要: import cv2 import numpy as np im = cv2.imread('in.tif',flags=(cv2.IMREAD_GRAYSCALE | cv2.IMREAD_ANYDEPTH)) height = im.shape[0] width = im.shape[1] pr 阅读全文
posted @ 2023-10-13 10:34 星河太守 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 从 https://earthexplorer.usgs.gov/ 下载高程数据 从谷歌地球上保存对应地区卫星图像 从灰度图创建地形模型,并将卫星影像作为贴图 效果如下 本文链接 https://www.cnblogs.com/gucheng/p/10951918.html 阅读全文
posted @ 2019-05-30 20:38 星河太守 阅读(4803) 评论(0) 推荐(1) 编辑
摘要: 准备灰度图 1、高程按比例对应hue色相(hsv)生成mesh效果 o.color = float4(hsv2rgb(float3(v.vertex.y/100.0, 0.5, 0.75)), 1.0); unity shader 2、高程按比例对应色带生成mesh效果 准备色带图 unity sh 阅读全文
posted @ 2019-05-29 18:15 星河太守 阅读(2469) 评论(0) 推荐(0) 编辑
摘要: 准备第三方库 glew、freeglut、glm、opencv 准备一张灰度图 最终效果 代码如下 #include <stdio.h> #include <string.h> #include <iostream> #include <fstream> #include <sstream> #in 阅读全文
posted @ 2018-12-20 22:33 星河太守 阅读(2448) 评论(0) 推荐(0) 编辑
摘要: 键盘wsad控制相机位移,鼠标左键按下控制相机旋转 效果如下 代码如下 #include <stdio.h> #include <string.h> #include <iostream> #include <fstream> #include <sstream> #include <GL/glew 阅读全文
posted @ 2018-12-18 19:46 星河太守 阅读(1818) 评论(0) 推荐(0) 编辑
摘要: 效果如图 准备第三方库 glew、freeglut、glm 代码包括主程序源文件mainApp.cpp、顶点着色器shader.vs、片元着色器shader.fs mainApp.cpp如下 #include <stdio.h> #include <string.h> #include <iostr 阅读全文
posted @ 2018-12-17 23:02 星河太守 阅读(1494) 评论(0) 推荐(0) 编辑
摘要: 准备第三方库 glew、freeglut、glm、opencv 准备灰度图片和草地贴图 最终效果 代码包括主程序源文件mainApp.cpp、顶点着色器shader.vs、片元着色器shader.fs mainApp.cpp如下 #include <stdio.h> #include <string 阅读全文
posted @ 2018-12-15 22:25 星河太守 阅读(3797) 评论(1) 推荐(0) 编辑
摘要: 准备一张贴图 创建材质球 球面坐标系转直角坐标系 x=rsinθcosφ. y=rsinθsinφ. z=rcosθ. 效果如下 脚本如下 using System.Collections; using System.Collections.Generic; using UnityEngine; / 阅读全文
posted @ 2018-12-14 21:57 星河太守 阅读(6247) 评论(0) 推荐(0) 编辑
摘要: 新建ue c++工程。 在Build.cs中添加"ProceduralMeshComponent"模块。 在 uproject中添加"ProceduralMeshComponent"模块。 创建材质,传入grass贴图 导入灰度图资源 创建继承自Actor的类 ATerrainCreateActor 阅读全文
posted @ 2018-12-13 22:21 星河太守 阅读(5470) 评论(0) 推荐(1) 编辑
摘要: 准备灰度图 grayTest.png,放置于Assets下StreamingAssets文件夹中。 在场景中添加RawImage用于显示最后的等值线图。 生成等值线的过程,使用Marching squares中Isolines方式。 https://en.wikipedia.org/wiki/Mar 阅读全文
posted @ 2018-12-12 12:38 星河太守 阅读(2213) 评论(0) 推荐(0) 编辑