地形之家提醒您当前使用的是IE浏览器,建议更换Chorme,Firebox等其他浏览器哦
WorldMachine

7. File Input and Output文件导入和导出

World Machine worlds only describe a set of operations to create the terrain rather than the terrain itself. The action of importing or exporting a terrain is described by adding device nodes to the world.

这是在World Machine世界中仅有的一组描述去创建地形而不是地形本身.这个导入或导出一个地形被形容为添加一个节点到世界中.


7.1 File Output文件导出

Saving a file to disk is a simple but important part of building your world. Exporting a file is done by using an Output Node to save terrain (or other data) to disk. There are several types of output possible, including terrain heightfields, meshes, and bitmaps. You can output many files from an individual world. For example, from a single project file you could save a terrain heightfield, a texture map to apply to the heightfield, and several additional masks for further use (perhaps in placing vegetation or other purposes).

保存一个文件到硬盘是再简单不过的事了但是也是创建世界的主要部分.一个文件被导出通过使用节点去保存地形(或其他数据)到硬盘.这里有几种可能的输出类型,包括地形高度域,网格,和位图.你可以导出许多种文件从一个单独的世界中.例如,一个单一的项目文件你可能保存为地形高度域文件,一个材质图可以为高度域显示,和为进一步使用一些额外的遮罩(也许被用在放置植被或其他目的).

To export data from World Machine, you must place an appropriate Output node from the toolbar into the world and wire your final terrain data into that node.

从World Machine中导出数据.你必须建立一个相应的输出节点从工具栏里并且连接你最终的地形数据进入该节点.


  Note: the area exported will always be the currently selected Render Extents!


  注意: 被导出的区域总是当前选择的渲染范围!


7.1.1 Heightfields高度域

To export a terrain heightfield, use the default File Output node that the starting world includes, or place a new File Output node into the world from the toolbar.

导出地形高度域,使用默认的文件输出节点,包括开始世界或从工具栏放置一个新的文件输出节点到世界.

You can export in many different formats, as seen above. Your choice of what format to use will be governed by the needs of your rendering software, terrain engine, or other further terrain application.

你可以导出许多不同的格式,在上图.你选择使用什么格式将受你的渲染软件,地形引擎,或其他更多的地形程序的需要.

The basic sequence of steps are:

基本顺序的步骤:

1. Select the file format you wish to export

1.选择要导出的文件格式

2. Set the filename by pushing the "Set" button and providing a filename

2. 通过"Set"按钮设置文件名

3. Push the "Write output to disk!" button to export the file.

3. 按"Write output to disk!"(将输出写入到磁盘!) 按钮来导出文件.

For more details on the various other options available in the File Output dialog, see the Device Reference.

对有关的各种文件输出对话框中的其他可用选项的更多详细信息,请参阅节点参考.


7.1.2 Terrain Meshes地形网格

The Mesh Output creates a triangulated mesh from the input heightfield. This is intended for general purpose rendering software or other applications that cannot use a Heightfield; The heightfield should be the preferred output method as it is a much more compact and efficient way of storing terrain data.

网格的输出会创建一个三角网格从输入的高度场.这是专为渲染软件或无法使用高度场的其他应用程序的通用手段.

The same three steps described in 7.1.1 are used to export a mesh, and indeed any of the file output devices.

7.1.1所述相同的三个步骤被适用于导出网格或者任何文件的输出节点.


7.1.3 Bitmaps位图

To export a bitmap, use the Bitmap Output device. This device accepts a bitmap datatype and an optional heightfield you can use to specify a 4th channel for alpha info.

对于导出一个位图,使用位图输出节点.此节点接受一个位图数据类型和可一个可选的高度域,你可以对alpha信息使用特殊的第4种通道.

Export Formats:导出格式:

● 8bit Windows BMP

● 16bit TIFF, PNG

The same three steps apply: Set a file format, set a filename, and click "Write output to disk".

这三个步骤适用于:设置文件格式,和点击"Write output to disk".


7.2 File Input文件导入

To import an existing file, use the File Input device. It can import a variety of file formats and brings them into the device world as either terrain heightfields or color bitmaps.The File Input is found under Generator Devices.

对于导入一个存在的文件,使用文件导入节点.它可以将各种文件格式导入到世界的节点作为地形高度域或颜色位图.文件输入位于生成器节点下.

For more information on the various options available in the File Input dialog, see the Device Reference. The most important ones will be described below.

需要了解更多有关文件输入对话框中可用的各种选项,看节点参考.下面将介绍最重要的.

Loading your file from disk从硬盘加载文件

Click on the "Load" button to browse to and select your input file. Once you've done so, WM will load it from disk; check to ensure that the "Original Size" readout matches what you expect. If you want to import a file as a Bitmap rather than a Heightfield, make sure that "Interpret as RGB" is checked.

点击"Load"按钮浏览选择你输入的文件.一旦你这么做的.WM将从硬盘加载;检查以确保"Original Size"(原始尺寸)读出与你所期望的相匹配.如果您要导入一个文件作为位图,而不是一个高度场,要确保"Interpret as RGB"被选中.

Locating your file in the world定位你的文件在世界的位置

It's very important to understand the relationship between your imported file, the world, and the area being viewed or exported. You can use file inputs for a great many things, from importing very large, rough guide maps that will be refined further in World Machine, to importing specific small features.

这是非常重要的去理解你导入的文件和之间的关系,世界和区域可以被查看或导出.你可以使用导入的文件做非常多的事.巨大的导入口,粗糙贴图指导不久将要被完善,来导入特定的性功能.

When you import a file, you also specify its location in world space via the options in the "World Placement" section.

当你导入一个文件,你也可以通过选项指定在世界空间中的位置,在"World Placement"部分.

The above view shows how this file input imports to a particular area of the world, which only partially overlaps with the current render extents (the white box).

上述观点表明,怎么样输入节点文件导入到世界的某一个区域,其中只有部分与当前的渲染范围重叠(就是这个白色的盒子).

You can either set the worldspace location numerically, or use one of the provided quick placement buttons to place the location of the file into the current render extents. You may also set the extents graphically by clicking the "Set in Layout..." button.

你可以设置空间位置的数值,或使用所提供的快速放置按钮其中的一个来放置该文件在当前渲染范围的位置.

Setting your file's elevations设置你文件的海拔

There are several ways you can map the file's elevations into the world:

有几种方法可以映射文件的海拔到世界里:

● Natural Elevations: Ensure that the height values in the input file are translated correctly into the same elevation in World Machine

● 自然海拔:确保输入文件中的高度值被被正确的转换成与World Machine相同的海拔.

● Full Range: Map the elevations present in the file so that the highest and lowest elevation completely span the possible elevation range inside of World Machine

● 全范围:映射存在文件的海拔,以便最高和最低海拔跨度尽可能的在World Machine的海拔范围.

● Specify: Specify an altitude range in meters that the input data should fall between.

● 指定:用单位(米)来指定海拔范围,输入数据应该介于之间.

After the mapping of height values, any heights out of range will be clipped to the minimum and maximum altitudes allowed.

在高度值映射之后,超出范围的任何高度将被剪切到允许的最小和最大高度.

You should now have all of the knowledge you need to be able to bring existing terrains into World Machine, operate on them, and export to a file. There is one more file input device, called the Tiled Input Device. It is designed to work on sets of individual tiles that collectively define a terrain region. As a professional-edition only feature, it is described in the Pro Addendum of Chapter 10.

你现在应该拥有所有的知识,你需要能够将现有存在于World Machine的地形操作他们并导出到一个文件.还有一个文件输入节点叫做Tiled Input Device,它的设计就是可以共同定义一个地形区域的各个图块的设置.作为一个专业版的功能高级的描述在第10章.