12 2018 档案

摘要:准备第三方库 glew、freeglut、glm、opencv 准备一张灰度图 最终效果 代码如下 #include <stdio.h> #include <string.h> #include <iostream> #include <fstream> #include <sstream> #in 阅读全文
posted @ 2018-12-20 22:33 星河太守 阅读(2892) 评论(0) 推荐(0)
摘要:键盘wsad控制相机位移,鼠标左键按下控制相机旋转 效果如下 代码如下 #include <stdio.h> #include <string.h> #include <iostream> #include <fstream> #include <sstream> #include <GL/glew 阅读全文
posted @ 2018-12-18 19:46 星河太守 阅读(1899) 评论(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 星河太守 阅读(1581) 评论(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 星河太守 阅读(3964) 评论(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 星河太守 阅读(6629) 评论(0) 推荐(0)
摘要:新建ue c++工程。 在Build.cs中添加"ProceduralMeshComponent"模块。 在 uproject中添加"ProceduralMeshComponent"模块。 创建材质,传入grass贴图 导入灰度图资源 创建继承自Actor的类 ATerrainCreateActor 阅读全文
posted @ 2018-12-13 22:21 星河太守 阅读(5630) 评论(0) 推荐(1)
摘要:准备灰度图 grayTest.png,放置于Assets下StreamingAssets文件夹中。 在场景中添加RawImage用于显示最后的等值线图。 生成等值线的过程,使用Marching squares中Isolines方式。 https://en.wikipedia.org/wiki/Mar 阅读全文
posted @ 2018-12-12 12:38 星河太守 阅读(2358) 评论(0) 推荐(0)
摘要:准备灰度图 IGray.png及草地贴图 IGrass.jpg ,放入Assets下StreamingAssets文件夹中。 创建空材质,用作参数传入脚本。 脚本如下,挂载并传入材质球即可根据灰度图生成mesh。 using System.Collections; using System.Coll 阅读全文
posted @ 2018-12-11 20:12 星河太守 阅读(4405) 评论(0) 推荐(0)