As featured in the CityEngine创建我的世界
Apply this Rule Package (RPK) as a Procedural point symbol in ArcGIS Pro to create textured 3D blocks from a grid of evenly-spaced points. The rule supports point feature classes spaced between 1m and 100m that have a Biome attribute that includes any of the following values:
将此规则包(RPK)作为ArcGIS Pro中的程序点符号应用,以从等间距点的网格中创建纹理3D块。该规则支持间距在1m和100m之间的点要素类,这些点要素类具有包含以下任何值的“生物特征”属性:
- Grass
- Taiga
- Dirt
- Diorite
- Sand
- Cloud
- Water
- Biome Attribute. The Biome attribute is defined, with a default value of “Grass”. When the RPK is applied in Pro, it will look for this attribute (and the 7 unique biome values) in the point feature class.
- Rule Parameters. Additional user-adjustable parameters are defined. This will expose the option to change the opacity/transparency of the cloud or water cubes. By default, they have a value of 1.0 and all cubes are fully opaque (no transparency).
- Texture Library. The textures to use for each biome type are defined and stored in a folder in the rule.
- Primitive Cube Start Rule. All CGA begins with a Start Rule. This is the first branch of the tree and where the CGA logic begins. From the start rule, additional branches of rules are attached. The @StartRule annotation above the rule logic indicates this is the start rule, and @InPoint defines that a point feature class is the expected input.
- Top / Side / Bottom Textures sub-Rules. These branch off the Start Rule and apply the appropriate textures to each face of the primitive cube, according to the textures defined in the library. and the sides of the cube: TopFace, SideFace, and BottomFace.
这是一个相对简单的CityEngine规则,是学习CityEngin使用的计算机生成体系结构(CGA)语言的良好起点。请参阅下面带注释的CGA代码,以查看不同的部分:
生物特征。Biome属性已定义,默认值为“Grass”。在Pro中应用RPK时,它将在点要素类中查找该属性(以及7个唯一的生物群落值)。
规则参数。定义了其他用户可调参数。这将显示更改云或水立方的不透明度/透明度的选项。默认情况下,它们的值为1.0,并且所有立方体都是完全不透明的(没有透明度)。
纹理库。每个生物群落类型使用的纹理都已定义并存储在规则中的文件夹中。
基本多维数据集开始规则。所有CGA都以开始规则开始。这是树的第一个分支,也是CGA逻辑的起点。从开始规则开始,附加规则的其他分支。规则逻辑上方的@StartRule注释表示这是开始规则,@InPoint定义点要素类是预期输入。
顶部/侧面/底部纹理子规则。这些分支脱离了“开始规则”,并根据库中定义的纹理将适当的纹理应用于基本体立方体的每个面。以及立方体的侧面:TopFace、SideFace和BottomFace。
- Replace the biome textures with your own versions. (the format used is .png, 160 x 160 pixels) Remember to keep the file names and locations the same, or else you will also have to update the texture file names in the Texture Library Section of the CGA.
- Change the default cloud or texture opacity (waterOpacityValue or cloudOpacityValue) in the Rule Parameters section of the CGA from 1.0 (opaque) to something partially-transparent (e.g., 0.5).
- For a bigger challenge, try adding additional Biome types to the CGA by following/duplicating the existing code logic.
在资源文件夹中,您可以找到每个生物群落立方体的纹理文件,在规则文件夹中,可以找到Minecraft_Cubes。可以在文本编辑器中打开和更改的cga。完成更改后,只需将文件夹压缩并将.zip扩展名更改为.rpk,然后将其应用于ArcGIS Pro中的点。
您可以尝试一些简单的CGA代码更改:
用自己的版本替换生物群落纹理。(使用的格式为.png,160 x 160像素)请记住保持文件名和位置不变,否则还必须更新CGA纹理库部分中的纹理文件名。
将CGA的“规则参数”部分中的默认云或纹理不透明度(waterOpacityValue或cloudOpacity Value)从1.0(不透明)更改为部分透明(例如,0.5)。
对于更大的挑战,尝试通过遵循/复制现有的代码逻辑,向CGA中添加更多的Biome类型。