高度图读写
5 个节点
本页内容 5
导出 OBJ
函数Exports the heightmap to an OBJ 3D file.
签名
导出 OBJ
高度图: Scalar Field
文件路径: 文本
使用四边形: 真否
包括法线: 真否
包括纹理坐标: 真否
顶点模式: 真否void ExportObj(
ScalarField2D heightmap,
string filePath,
bool useQuads = false,
bool includeNormals = false,
bool includeTextureCoords = false,
bool vertexMode = false)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 高度图 | Scalar Field | — | |
| 文件路径 | 文本 | — | The path to the OBJ file to be created. |
| 使用四边形 | 真否 | False | If true, exports using quads; otherwise, uses triangles. |
| 包括法线 | 真否 | False | |
| 包括纹理坐标 | 真否 | False | |
| 顶点模式 | 真否 | False | If true, consider each vertex in the data array as center of each pixel, we need to create new vertices based on the center. |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 高度图读写
- 所属包
- 程序化生成
加载高度图
函数从文件读取以米为单位的高度图:带像元大小的 GeoTIFF 高程栅格、16 位或 8 位图像,或引擎使用的 16 位原始网格(.r16、.raw)。
签名
加载高度图 -> Scalar Field
路径: 文本
像元大小(米): 数字
最低(米): 数字
最高(米): 数字ScalarField2D LoadHeightmap(
string path,
double cellSizeMetres = 0,
double lowestMetres = 0,
double highestMetres = 0)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 路径 | 文本 | — | The file. |
| 像元大小(米) | 数字 | 0 | Ground metres one cell covers. A GeoTIFF says this itself and 0 takes its word; an image or raw grid needs it, and is laid at a metre a cell when it is 0. |
| 最低(米) | 数字 | 0 | For an image or raw grid, the elevation its darkest value stands for. A TIFF's values are already metres. |
| 最高(米) | 数字 | 0 | For an image or raw grid, the elevation its brightest value stands for; no higher than the lowest leaves its values 0..1. |
返回
| 高度图 | Scalar Field |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 高度图读写
- 所属包
- 程序化生成
保存为 OBJ 网格
函数Save the terrrain into .obj 3D grid mesh format.
签名
保存为 OBJ 网格(地形: Scalar Field, 输出路径: 文本, 优化: 真否)
void SaveAsObjMesh(
ScalarField2D terrain,
string outputPath,
bool optimized = false)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 地形 | Scalar Field | — | |
| 输出路径 | 文本 | — | |
| 优化 | 真否 | False |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 高度图读写
- 所属包
- 程序化生成
保存高度图
函数保存高度图:.tif 保留米制高度与像元大小,.png 为 16 位灰度图像,.r16 为 16 位原始网格。
签名
保存高度图 -> 文本
高度图: Scalar Field
路径: 文本
精度(米): 数字string SaveHeightmap(
ScalarField2D heightmap,
string path,
double precisionMetres = 0.01)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 高度图 | Scalar Field | — | Heights in metres. |
| 路径 | 文本 | — | Where to save it: .tif, .png or .r16. |
| 精度(米) | 数字 | 0.01 | For a .tif, the step heights are stored to, metres: 0.01 keeps them to a centimetre. 0 stores 32-bit floats. |
返回
| 已保存 | 文本 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 高度图读写
- 所属包
- 程序化生成
设置像元大小
函数同样的高度铺在更大或更小的地面上:给生成的高度图一个应有的大小。
签名
设置像元大小 -> Scalar Field
高度图: Scalar Field
像元大小(米): 数字ScalarField2D SetCellSize(
ScalarField2D heightmap,
double cellSizeMetres = 2)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 高度图 | Scalar Field | — | Heights in metres. |
| 像元大小(米) | 数字 | 2 | Ground metres one cell covers. |
返回
| 高度图 | Scalar Field |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 高度图读写
- 所属包
- 程序化生成