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
Rule parameters allow you to scale the size of the cubes or adjust the transparency of the Cloud and/or Water biome types, if desired:
如果需要,规则参数允许您缩放立方体的大小或调整云和/或水生物群落类型的透明度:
data
This is a relatively simple CityEngine rule that is a good starting point for learning the Computer Generated Architecture (CGA) language used by CityEngine. Refer to the annotated CGA code below to see the different parts:
  1. 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.
  2. 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).
  3. Texture Library. The textures to use for each biome type are defined and stored in a folder in the rule.
  4. 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.
  5. 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: TopFaceSideFace, and BottomFace.

这是一个相对简单的CityEngine规则,是学习CityEngin使用的计算机生成体系结构(CGA)语言的良好起点。请参阅下面带注释的CGA代码,以查看不同的部分:
生物特征。Biome属性已定义,默认值为“Grass”。在Pro中应用RPK时,它将在点要素类中查找该属性(以及7个唯一的生物群落值)。
规则参数。定义了其他用户可调参数。这将显示更改云或水立方的不透明度/透明度的选项。默认情况下,它们的值为1.0,并且所有立方体都是完全不透明的(没有透明度)。
纹理库。每个生物群落类型使用的纹理都已定义并存储在规则中的文件夹中。
基本多维数据集开始规则。所有CGA都以开始规则开始。这是树的第一个分支,也是CGA逻辑的起点。从开始规则开始,附加规则的其他分支。规则逻辑上方的@StartRule注释表示这是开始规则,@InPoint定义点要素类是预期输入。
顶部/侧面/底部纹理子规则。这些分支脱离了“开始规则”,并根据库中定义的纹理将适当的纹理应用于基本体立方体的每个面。以及立方体的侧面:TopFace、SideFace和BottomFace。

data
data

 

Unzip the RPK
CityEngine-authored Rule Packages (*.rpk) are just zip files, so it’s actually possible to make small changes to the CGA logic or texture library even if you don’t have CityEngine installed — but are familiar with the syntax. After unzipping the Minecraft_Cubes.rpk, you will see this file structure:
CityEngine编写的规则包(*.rpk)只是zip文件,因此即使您没有安装CityEngin,也可以对CGA逻辑或纹理库进行小的更改,但您熟悉语法。解压缩Minecraft_Cubes后。rpk,您将看到以下文件结构:
data
Inside the assets folder, you will find the texture files for each biome cube, and in the rules folder you will find the Minecraft_Cubes.cga which you can open and alter in a text editor. Once you’ve made your changes, simply zip the folders back up and change the .zip extension to .rpk, then apply it to your points in ArcGIS Pro.
Some simple CGA code changes you can experiment with:
  • 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类型。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。