@anov/gis-skills-cli 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +618 -0
- package/INSTALL.md +478 -0
- package/LICENSE +15 -0
- package/README.md +148 -2
- package/RELEASING.md +160 -0
- package/bin/anov-gis-skills.mjs +408 -0
- package/lib/mcp-config.mjs +273 -0
- package/package.json +42 -4
- package/skills/anovgis-analysis/SKILL.md +585 -0
- package/skills/anovgis-effects/SKILL.md +260 -0
- package/skills/anovgis-imagery-terrain/SKILL.md +505 -0
- package/skills/anovgis-layers/SKILL.md +627 -0
- package/skills/anovgis-materials/SKILL.md +635 -0
- package/skills/anovgis-models-3dtiles/SKILL.md +448 -0
- package/skills/anovgis-pitfalls/SKILL.md +561 -0
- package/skills/anovgis-popup-widget/SKILL.md +474 -0
- package/skills/anovgis-primitives/SKILL.md +482 -0
- package/skills/anovgis-vector-graphics/SKILL.md +602 -0
- package/skills/anovgis-viewer/SKILL.md +618 -0
- package/skills/using-anovgis/DEMO-MAP.md +64 -0
- package/skills/using-anovgis/DEMO-SKILL-MAP.md +248 -0
- package/skills/using-anovgis/DOMAINS.md +183 -0
- package/skills/using-anovgis/REFERENCE.md +114 -0
- package/skills/using-anovgis/SKILL.md +392 -0
- package/skills/using-anovgis/templates/README.md +154 -0
- package/skills/using-anovgis/templates/combo1-vue3-vite.md +295 -0
- package/skills/using-anovgis/templates/combo2-vue2-cli.md +119 -0
- package/skills/using-anovgis/templates/combo3-html-cdn.md +107 -0
- package/skills/using-anovgis/templates/combo4-vanilla-webpack.md +91 -0
- package/skills/using-anovgis/templates/wizard-profiles.md +105 -0
- package/vendor/cesiumjs-skills/LICENSE +201 -0
- package/vendor/cesiumjs-skills/NOTICE +18 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-3d-tiles/SKILL.md +465 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-camera/SKILL.md +500 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-core-utilities/SKILL.md +403 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/REFERENCE.md +397 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/SKILL.md +351 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/01-diffuse-tint.js +38 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/02-texture-swap.js +42 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/03-feature-id-tileset.js +29 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/04-translucent-override.js +37 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/05-vertex-displacement.js +49 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/06-metadata-ramp.js +34 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/07-voxel-shader.js +27 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/README.md +19 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-custom-shader/examples/_sandcastle-template.html +9 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-entities/SKILL.md +389 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-imagery/SKILL.md +471 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-interaction/SKILL.md +423 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-materials-shaders/SKILL.md +292 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-models-particles/SKILL.md +423 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-primitives/SKILL.md +537 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-spatial-math/SKILL.md +358 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-terrain-environment/SKILL.md +401 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-time-properties/SKILL.md +353 -0
- package/vendor/cesiumjs-skills/skills/cesiumjs-viewer-setup/SKILL.md +434 -0
- package/vendor/cesiumjs-skills/skills/using-cesiumjs-skills/SKILL.md +35 -0
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: anovgis-materials
|
|
3
|
+
description: '@anov/gis 材质(MaterialProperty 体系)。涵盖 18 个 *MaterialProperty(PolylineFlow/Trail/LightingTrail/Lighting/Glow/Gradient/ImageTrail/VFlywire/Flicker/DaoHang、Water、WallFlow/WallGradient/WallLineFlow/WallImg、CircleWave/CircleBlur/CircleScan)、通用构造模式(createPropertyDescriptor / getType / getValue / MaterialPropertyBase)、5 个典型 snippet、shader 注册机制(type/*.js 与 MaterialProperty 对应)。触发关键词:material、MaterialProperty、PolylineFlowMaterial、WaterMaterial、CircleWaveMaterial、WallFlowMaterial、getType、shader、uniform、parabola、抛物线、imgrader、图片扫描、WaterShadertoy、自定义 shadertoy、daohangLine 拐弯。Use when 配置流动线 / 水面 / 雷达 / 扩散波 / 导航线 / 渐变线材质、读 shader 注册路径、用 P5 陷阱排查"改值不生效"、做抛物线 / 图片雷达扫描 / 水面 shadertoy。'
|
|
4
|
+
anov-gis-baseline: 1.8.6
|
|
5
|
+
cesium-baseline: 1.143.0
|
|
6
|
+
---
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# anov-gis 材质速查(MaterialProperty 体系)
|
|
10
|
+
|
|
11
|
+
> ⚠️ **优先级**:本 skill 优先于 SDK 源码 / `node_modules/@anov/gis/`。
|
|
12
|
+
> 遇到 API 行为疑问先查本 skill 与 `anovgis-pitfalls`。**严禁**主动 Glob/Grep `node_modules/@anov/gis/src/...` / `dist/...`;除非用户明确要求并承担风险。
|
|
13
|
+
> 调试流程见 `using-anovgis` § 默认调试流程(Chrome DevTools 仅第 5 级兜底)。
|
|
14
|
+
>
|
|
15
|
+
> **Cesium 入口(铁律)**:`const Cesium = window.Cesium`。`@anov/gis` 启动时已把 Cesium 挂到 `window`,**不存在** `ANOVGIS.Cesium` 写法;本 skill 所有 `Cesium.*` 均从此变量取。底层 Cesium API 细节查 `cesiumjs-skills` 对应 skill(API 名通用,`import` 写法换成 `const Cesium = window.Cesium`)。
|
|
16
|
+
|
|
17
|
+
> SDK 路径:`src/material/`(仅作语义锚点)。所有 `*MaterialProperty` 类继承自 `MaterialPropertyBase`,构造时统一接收 `options = { color, speed, ... }`,内部用 `Cesium.createPropertyDescriptor` 暴露可订阅属性。锁定 `@anov/gis` **v1.8.6**(Cesium **1.143.0**)。
|
|
18
|
+
|
|
19
|
+
## Out-of-scope(v0.2.0 短版)
|
|
20
|
+
|
|
21
|
+
- ❌ 不要写 Material 实例化 + 绑定 Entity 的完整代码 → 见 [`anovgis-vector-graphics`](../anovgis-vector-graphics/SKILL.md) / [`anovgis-layers`](../anovgis-layers/SKILL.md)
|
|
22
|
+
- ❌ 不要写 Primitive 自带材质版本(`ScanCirclePrimitive` / `DiffuseWallPrimitive` / `FlowLinePrimitive` / `WaterPrimitive` 等独立 Graphic) → [`anovgis-primitives`](../anovgis-primitives/SKILL.md)
|
|
23
|
+
- ❌ 不要写自定义 GLSL shader 编写(`WaterShadertoy` 等) → v0.3.0 `anovgis-custom-primitive-worker`
|
|
24
|
+
- ❌ 不要写 18 个 Property 之外的内部 Material(如 `Cesium.Material._materialCache` 直接注册) → 见 SDK 源码 `src/material/type/`
|
|
25
|
+
>
|
|
26
|
+
> **⚠️ P5 陷阱(务必先读)**:MaterialProperty 子字段(`.x` / `.rgb` / `.red` 等)赋值不会触发 setter,GPU uniform 不更新。**必须整体赋新对象**:`material.color = new Cesium.Color(...)`、`material.repeat = new Cesium.Cartesian2(...)`。
|
|
27
|
+
>
|
|
28
|
+
> 完整排查(为什么 / 排查信号 / 源码定位)见 [`anovgis-pitfalls` P5](../anovgis-pitfalls/SKILL.md#p5-materialproperty)。
|
|
29
|
+
|
|
30
|
+
## 1. 速查表(按用途分组)
|
|
31
|
+
|
|
32
|
+
### 1.1 线材质(Polyline 类)
|
|
33
|
+
|
|
34
|
+
| 类名 | 文件 | 关键参数 | demo |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| `PolylineFlowMaterialProperty` | `property/polyline/` | `color, speed, percent, gradient` | `material/flowPolyline.html` |
|
|
37
|
+
| `PolylineTrailMaterialProperty` | `property/polyline/` | `color, speed` | `material/polylineTrail.html` |
|
|
38
|
+
| `PolylineLightingTrailMaterialProperty` | `property/polyline/` | `color, speed` | `material/PolylineLighting.html` |
|
|
39
|
+
| `PolylineLightingMaterialProperty` | `property/polyline/` | `color, speed` | `material/PolylineLighting.html` |
|
|
40
|
+
| `PolylineGlowMaterialProperty` | `property/polyline/` | `color, glowPower, taperPower` | (shader 注册) |
|
|
41
|
+
| `PolylineGradientMaterialProperty` | `property/polyline/` | `duration`(`image` 内部硬编码 `linegradient.png`) | (shader 注册) |
|
|
42
|
+
| `PolylineImageTrailMaterialProperty` | `property/polyline/` | `color, image, speed, repeat: {x, y}` | `material/ImageTrailPolyline.html` |
|
|
43
|
+
| `PolylineVFlywireMaterialPoperty` | `property/polyline/` | `color, speed, percent, gradient` | `material/VFlywire.html` |
|
|
44
|
+
| `PolylineFlickerMaterialProperty` | `property/polyline/` | `color, speed` | (shader 注册) |
|
|
45
|
+
| `DaoHangLineMaterialProperty` | `property/polyline/` | `color1, color2, whiteLength, greenLength, lineWidth, speed, direction, arrowLengthRatio, arrowWidthRatio` | `material/daohangLine.html` |
|
|
46
|
+
|
|
47
|
+
### 1.2 面材质(Polygon / Wall / Ellipse)
|
|
48
|
+
|
|
49
|
+
| 类名 | 文件 | 关键参数 | demo |
|
|
50
|
+
|---|---|---|---|
|
|
51
|
+
| `WaterMaterialProperty` | `property/water/` | `baseWaterColor, blendColor, specularMap, normalMap, frequency, animationSpeed, amplitude, specularIntensity` | `material/water.html` |
|
|
52
|
+
| `WallFlowMaterialProperty` | `property/wall/` | `color, image, speed, rep, brightness, duration` | `geojsonLayer/wallBuilds.html` |
|
|
53
|
+
| `WallGradientMaterialProperty` | `property/wall/` | `color, image, direction, duration, brightness` | `geojsonLayer/wallBuilds.html` L108-111 |
|
|
54
|
+
| `WallLineFlowMaterialProperty` | `property/wall/` | `color, image, speed, copy` | (shader 注册) |
|
|
55
|
+
| `WallImgMaterialProperty` | `property/wall/` | `color, image, isTranslucent` | (shader 注册) |
|
|
56
|
+
|
|
57
|
+
### 1.3 点 / 圆 / 球材质
|
|
58
|
+
|
|
59
|
+
| 类名 | 文件 | 关键参数 | demo |
|
|
60
|
+
|---|---|---|---|
|
|
61
|
+
| `CircleWaveMaterialProperty` | `property/wave/` | `color, duration, count, gradient` | `material/circleWave.html` |
|
|
62
|
+
| `CircleBlurMaterialProperty` | `property/circle/` | `color, speed` | `material/circleBlur.html` |
|
|
63
|
+
| `CircleScanMaterialProperty` | `property/circle/` | `color, speed` | 无 demo(参考 `src/graphic/primitive/ScanCirclePrimitive.js`) |
|
|
64
|
+
|
|
65
|
+
> 注:原始图元(`ScanCirclePrimitive` / `DiffuseWallPrimitive` / `FlowLinePrimitive`)无对应 MaterialProperty,是 `Graphic` 子类直接 `new ANOVGIS.XxxPrimitive(...)`,详见 [`anovgis-vector-graphics`](../anovgis-vector-graphics/SKILL.md)。
|
|
66
|
+
|
|
67
|
+
## 2. 通用构造模式
|
|
68
|
+
|
|
69
|
+
所有 Property 子类都遵循:
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
class XxxMaterialProperty extends MaterialPropertyBase {
|
|
73
|
+
constructor(options = {}) {
|
|
74
|
+
super(options) // 统一处理 color / speed
|
|
75
|
+
this.字段A = options.字段A ?? 默认值
|
|
76
|
+
}
|
|
77
|
+
getType(time) { return 'CesiumType名' } // 对应 src/material/type/*.js 注册
|
|
78
|
+
getValue(time, result) { /* 写 result.字段 */ }
|
|
79
|
+
equals(other) { /* 比较 */ }
|
|
80
|
+
}
|
|
81
|
+
Object.defineProperties(XxxMaterialProperty.prototype, {
|
|
82
|
+
color: Cesium.createPropertyDescriptor('color'),
|
|
83
|
+
字段A: Cesium.createPropertyDescriptor('字段A'),
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**关键点**:
|
|
88
|
+
|
|
89
|
+
1. `getType()` 返回的字符串必须与 `src/material/type/*.js` 中 `Cesium.Material._materialCache.addMaterial(...)` 注册的 type 一致(如 SDK 自注册 `'PolylineFlow'`、`'CircleWaveMaterial'`、`'WallLineFlow'`、`'WallGradient'`,以及 Cesium 内建的 `'Water'`)。注:`Cesium.Material.PolylineFlowType` 的实际值是 `'PolylineFlow'`,常量名 ≠ 注册 type。
|
|
90
|
+
2. `getValue(time, result)` 把当前 uniform 值写入 `result` 对象,由 Cesium 框架逐帧调用。
|
|
91
|
+
3. `MaterialPropertyBase` 已在内部处理 `color` 与 `speed` 的默认值(cyan + 1),子类通常只需扩展自己的字段。
|
|
92
|
+
|
|
93
|
+
## 3. 典型 Snippet
|
|
94
|
+
|
|
95
|
+
<a id="flow"></a>
|
|
96
|
+
### 3.1 Polyline + PolylineFlowMaterialProperty(流动线)
|
|
97
|
+
|
|
98
|
+
来源:`examples/public/examples/html/material/flowPolyline.html` L55-64
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
let polyline = new ANOVGIS.Polyline('116, 38; 119, 38').setOptions({
|
|
102
|
+
width: 5,
|
|
103
|
+
material: new ANOVGIS.PolylineFlowMaterialProperty({
|
|
104
|
+
color: Cesium.Color.RED, speed: 5, gradient: 0.6, percent: 0.5,
|
|
105
|
+
}),
|
|
106
|
+
clampToGround: false,
|
|
107
|
+
})
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
<a id="water"></a>
|
|
111
|
+
### 3.2 Polygon + WaterPrimitive(Primitive 版水面)
|
|
112
|
+
|
|
113
|
+
来源:`src/graphic/primitive/WaterPrimitive.js`(封装 `GroundPrimitive` + `Cesium.Material.fromType('Water', ...)`)
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
const layer = new ANOVGIS.PrimitiveLayer().addTo(viewer)
|
|
117
|
+
const water = new ANOVGIS.WaterPrimitive('116.4, 39.9; 116.5, 39.9; 116.5, 40.0; 116.4, 40.0')
|
|
118
|
+
water.setOptions({
|
|
119
|
+
height: 200, extrudedHeight: 100,
|
|
120
|
+
baseWaterColor: Cesium.Color.fromCssColorString('#006ab4').withAlpha(0.5),
|
|
121
|
+
blendColor: new Cesium.Color(1.0, 1.0, 1.0, 0.5),
|
|
122
|
+
specularIntensity: 0.8,
|
|
123
|
+
frequency: 800.0, animationSpeed: 0.02, amplitude: 15.0,
|
|
124
|
+
})
|
|
125
|
+
layer.addGraphic(water)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
注:`WaterPrimitive` 继承 `Graphic`,用 `setOptions()` 改 uniform;与 `*MaterialProperty`(entity 的 `material` 字段)是两条平行体系。
|
|
129
|
+
|
|
130
|
+
<a id="circle-wave"></a>
|
|
131
|
+
### 3.3 Ellipse + CircleWaveMaterialProperty(扩散波)
|
|
132
|
+
|
|
133
|
+
来源:`examples/public/examples/html/material/circleWave.html` L65-83
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
viewer.entities.add({
|
|
137
|
+
id: 'circlewave1',
|
|
138
|
+
position: Cesium.Cartesian3.fromDegrees(116.397428, 39.90923, 0),
|
|
139
|
+
ellipse: {
|
|
140
|
+
semiMinorAxis: new Cesium.CallbackProperty(() => 800, false),
|
|
141
|
+
semiMajorAxis: new Cesium.CallbackProperty(() => 800, false),
|
|
142
|
+
material: new ANOVGIS.CircleWaveMaterialProperty({
|
|
143
|
+
duration: 3000, gradient: 0.5,
|
|
144
|
+
color: Cesium.Color.fromCssColorString('rgba(59,179,249,0.7)'),
|
|
145
|
+
count: 4,
|
|
146
|
+
}),
|
|
147
|
+
},
|
|
148
|
+
})
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 3.4 雷达扫描(CircleScan / ScanCirclePrimitive)
|
|
152
|
+
|
|
153
|
+
来源 A:`material/circleBlur.html`(结构同 3.3,换 `CircleScanMaterialProperty({ color, speed })`)
|
|
154
|
+
|
|
155
|
+
来源 B:`examples/public/examples/html/model/cesium_three.html` L309-316
|
|
156
|
+
|
|
157
|
+
```js
|
|
158
|
+
const layer = new ANOVGIS.PrimitiveLayer().addTo(viewer)
|
|
159
|
+
const scan = new ANOVGIS.ScanCirclePrimitive(
|
|
160
|
+
Cesium.Cartesian3.fromDegrees(119.506, 35.361), 1000)
|
|
161
|
+
scan.setOptions({ speed: 5, color: new Cesium.Color(0.5, 0.8, 1.0, 1.0) })
|
|
162
|
+
layer.addGraphic(scan)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 3.5 Wall + WallFlowMaterialProperty(流动墙体)
|
|
166
|
+
|
|
167
|
+
来源:`examples/public/examples/html/geojsonLayer/wallBuilds.html` L91-107
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
viewer.entities.add({
|
|
171
|
+
name: entity.name,
|
|
172
|
+
wall: {
|
|
173
|
+
positions: Cesium.Cartesian3.fromDegreesArray(postion),
|
|
174
|
+
maximumHeights: new Array(cor.coordinates.length).fill(cor.height),
|
|
175
|
+
minimumHeights: new Array(cor.coordinates.length).fill(0),
|
|
176
|
+
material: new ANOVGIS.WallFlowMaterialProperty({
|
|
177
|
+
color: Cesium.Color.fromCssColorString(entity.color),
|
|
178
|
+
duration: 2500,
|
|
179
|
+
}),
|
|
180
|
+
},
|
|
181
|
+
})
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
扩散墙效果改用 `new ANOVGIS.DiffuseWallPrimitive(center, radius, height)`(Primitive 而非 Property)。
|
|
185
|
+
|
|
186
|
+
## 各 MaterialProperty 实战补充
|
|
187
|
+
|
|
188
|
+
<a id="image-trail"></a>
|
|
189
|
+
### 线材质
|
|
190
|
+
|
|
191
|
+
#### PolylineTrailMaterialProperty(尾迹线,不发光)
|
|
192
|
+
|
|
193
|
+
```js
|
|
194
|
+
// 来源: polylineTrail.html L31-45
|
|
195
|
+
const roads = new ANOVGIS.GeoJsonLayer('../modelData/json/road_shanghai.json')
|
|
196
|
+
roads.eachGraphic((graphic) => {
|
|
197
|
+
if (!graphic.polyline) return
|
|
198
|
+
ANOVGIS.Util.merge(graphic.polyline, {
|
|
199
|
+
width: 3,
|
|
200
|
+
material: new ANOVGIS.PolylineTrailMaterialProperty({
|
|
201
|
+
color: ANOVGIS.Color.ORANGE.withAlpha(1),
|
|
202
|
+
speed: 6,
|
|
203
|
+
}),
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
viewer.addLayer(roads)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### PolylineLightingTrailMaterialProperty(泛光尾迹)
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
// 来源: PolylineLighting.html L142-158
|
|
213
|
+
const lightingTrail = viewer.entities.add({
|
|
214
|
+
polyline: {
|
|
215
|
+
positions,
|
|
216
|
+
width: 15,
|
|
217
|
+
clampToGround: true,
|
|
218
|
+
material: new ANOVGIS.PolylineLightingTrailMaterialProperty({
|
|
219
|
+
color: Cesium.Color.fromCssColorString('#66e633'),
|
|
220
|
+
speed: 10,
|
|
221
|
+
}),
|
|
222
|
+
},
|
|
223
|
+
})
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### PolylineGlowMaterialProperty / PolylineGradientMaterialProperty(渐变线)
|
|
227
|
+
|
|
228
|
+
```js
|
|
229
|
+
// 来源: PolylineLighting.html L69-80
|
|
230
|
+
const glow = new ANOVGIS.PolylineGlowMaterialProperty({
|
|
231
|
+
color: new Cesium.Color(1, 0.27, 0, 0.9),
|
|
232
|
+
glowPower: 0.2,
|
|
233
|
+
taperPower: 1,
|
|
234
|
+
})
|
|
235
|
+
const gradient = new ANOVGIS.PolylineGradientMaterialProperty({
|
|
236
|
+
duration: 2000,
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
// 两种材质任选其一;切换时整体替换 material
|
|
240
|
+
entity.polyline.width = 13
|
|
241
|
+
entity.polyline.material = glow
|
|
242
|
+
// entity.polyline.material = gradient
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### PolylineImageTrailMaterialProperty(图片纹理流动)
|
|
246
|
+
|
|
247
|
+
```js
|
|
248
|
+
// 来源: ImageTrailPolyline.html L137-151
|
|
249
|
+
polyline.setOptions({
|
|
250
|
+
width: 10,
|
|
251
|
+
clampToGround: true,
|
|
252
|
+
material: new ANOVGIS.PolylineImageTrailMaterialProperty({
|
|
253
|
+
color: Cesium.Color.CYAN,
|
|
254
|
+
speed: 10,
|
|
255
|
+
image: './images/thumbs/material/arrow_1.png',
|
|
256
|
+
repeat: new Cesium.Cartesian2(40, 1),
|
|
257
|
+
}),
|
|
258
|
+
})
|
|
259
|
+
// 动态修改 repeat 时同样整体赋值:material.repeat = new Cesium.Cartesian2(20, 1)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
<a id="circle-blur"></a>
|
|
263
|
+
### 面材质
|
|
264
|
+
|
|
265
|
+
#### WallLineFlowMaterialProperty / WallGradientMaterialProperty(墙体流光与渐变)
|
|
266
|
+
|
|
267
|
+
```js
|
|
268
|
+
// 来源: waterShadertoy.html L139-163
|
|
269
|
+
const wallPositions = Cesium.Cartesian3.fromDegreesArrayHeights([
|
|
270
|
+
116.38, 39.98, 0, 116.38, 39.99, 800, 116.39, 39.98, 0,
|
|
271
|
+
])
|
|
272
|
+
const wall = viewer.entities.add({
|
|
273
|
+
wall: {
|
|
274
|
+
positions: wallPositions,
|
|
275
|
+
material: new ANOVGIS.WallLineFlowMaterialProperty({
|
|
276
|
+
color: Cesium.Color.CYAN,
|
|
277
|
+
speed: 100,
|
|
278
|
+
copy: new Cesium.Cartesian2(2, 1),
|
|
279
|
+
}),
|
|
280
|
+
},
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
// 渐变墙体:direction=1 表示从下往上
|
|
284
|
+
// wall.wall.material = new ANOVGIS.WallGradientMaterialProperty({
|
|
285
|
+
// color: Cesium.Color.CYAN, direction: 1, duration: 2500, brightness: 1.5,
|
|
286
|
+
// })
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### 点 / 圆 / 球材质
|
|
290
|
+
|
|
291
|
+
#### CircleBlurMaterialProperty(扩散模糊圆)
|
|
292
|
+
|
|
293
|
+
```js
|
|
294
|
+
// 来源: circleBlur.html L45-57
|
|
295
|
+
const layer = new ANOVGIS.VectorLayer().addTo(viewer)
|
|
296
|
+
const circle = new ANOVGIS.Circle(
|
|
297
|
+
ANOVGIS.Position.fromObject({ lng: 116, lat: 39 }),
|
|
298
|
+
2000,
|
|
299
|
+
)
|
|
300
|
+
circle.setOptions({
|
|
301
|
+
classificationType: 0,
|
|
302
|
+
material: new ANOVGIS.CircleBlurMaterialProperty({
|
|
303
|
+
color: Cesium.Color.YELLOW.withAlpha(0.2),
|
|
304
|
+
speed: 10,
|
|
305
|
+
}),
|
|
306
|
+
})
|
|
307
|
+
layer.addGraphic(circle)
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### CircleScanMaterialProperty(图片雷达)
|
|
311
|
+
|
|
312
|
+
```js
|
|
313
|
+
// 来源: imgrader.html L63-91
|
|
314
|
+
const radar = viewer.entities.add({
|
|
315
|
+
position: Cesium.Cartesian3.fromDegrees(119.506, 35.361),
|
|
316
|
+
ellipse: {
|
|
317
|
+
semiMajorAxis: 500,
|
|
318
|
+
semiMinorAxis: 500,
|
|
319
|
+
material: new ANOVGIS.CircleScanMaterialProperty({
|
|
320
|
+
color: Cesium.Color.fromCssColorString('rgba(36,229,104,0.5)'),
|
|
321
|
+
speed: 1.5,
|
|
322
|
+
}),
|
|
323
|
+
height: 20,
|
|
324
|
+
heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND,
|
|
325
|
+
},
|
|
326
|
+
})
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
> 动态调色、重复次数或纹理缩放时,遵守顶部 P5:`color`、`repeat`、`copy` 等对象字段必须整体赋新对象,不能只改 `.red`、`.x` 等子字段。
|
|
330
|
+
|
|
331
|
+
<a id="parabola"></a>
|
|
332
|
+
### 流动抛物线 + V 型飞线(补充实战)
|
|
333
|
+
|
|
334
|
+
#### FlowLinePrimitive + ANOVGIS.parabola(中心, 目标, 抛物线最大高度)
|
|
335
|
+
|
|
336
|
+
```js
|
|
337
|
+
// 来源: parabola.html L55-78
|
|
338
|
+
let layer = new ANOVGIS.PrimitiveLayer({ id: 'layer' }).addTo(viewer);
|
|
339
|
+
let center = ANOVGIS.Position.fromObject({ lng: 121.495, lat: 31.241 });
|
|
340
|
+
|
|
341
|
+
let positions = [
|
|
342
|
+
{ lng: 121.465, lat: 31.254 },
|
|
343
|
+
{ lng: 121.481, lat: 31.227 },
|
|
344
|
+
// ...省略若干条
|
|
345
|
+
];
|
|
346
|
+
positions.forEach(item => {
|
|
347
|
+
// ANOVGIS.parabola(中心点, 目标点, 抛物线最大高度)
|
|
348
|
+
let line = new ANOVGIS.FlowLinePrimitive(ANOVGIS.parabola(center, item, 500), 5);
|
|
349
|
+
line.setOptions({
|
|
350
|
+
speed: 5 * Math.random(),
|
|
351
|
+
color: new Cesium.Color(0.5, 0.8, 1.0, 0.9),
|
|
352
|
+
gradient: 0.3,
|
|
353
|
+
percent: 0.1,
|
|
354
|
+
});
|
|
355
|
+
layer.addGraphic(line);
|
|
356
|
+
});
|
|
357
|
+
viewer.flyToPosition('121.495,31.241,3859,0,-28');
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
#### PolylineVFlywireMaterialPoperty(竖向流光, 注意 SDK 拼写: Poperty 少一个 r)
|
|
361
|
+
|
|
362
|
+
```js
|
|
363
|
+
// 来源: VFlywire.html L67-93
|
|
364
|
+
// 注意: API 拼写是 SDK 既定 "Poperty" (少一个 r),不要纠正为 Property
|
|
365
|
+
function showFlywire(centerLngLat, count) {
|
|
366
|
+
const positions = generateRandomPosition(centerLngLat, count); // [[lng, lat], ...]
|
|
367
|
+
positions.forEach(([lng, lat]) => {
|
|
368
|
+
const start = Cesium.Cartesian3.fromDegrees(lng, lat, 0);
|
|
369
|
+
const end = Cesium.Cartesian3.fromDegrees(lng, lat, 20000); // 20km 高空
|
|
370
|
+
viewer.entities.add({
|
|
371
|
+
polyline: {
|
|
372
|
+
positions: [start, end],
|
|
373
|
+
material: new ANOVGIS.PolylineVFlywireMaterialPoperty({
|
|
374
|
+
color: Cesium.Color.fromCssColorString('rgba(63,140,255,0.8)'),
|
|
375
|
+
speed: Math.round(Math.random() * 15),
|
|
376
|
+
percent: 0.1,
|
|
377
|
+
gradient: 0.01,
|
|
378
|
+
}),
|
|
379
|
+
},
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
<a id="daohang"></a>
|
|
386
|
+
### 导航线(DaoHangLine)拐弯效果
|
|
387
|
+
|
|
388
|
+
```js
|
|
389
|
+
// 来源: daohangLineTest.html L54-86(单条最简版)
|
|
390
|
+
// 关键字段: color1(头色) / color2(尾色) / whiteLength / greenLength /
|
|
391
|
+
// lineWidth / speed / direction(-1=正, 1=反) /
|
|
392
|
+
// arrowLengthRatio / arrowWidthRatio
|
|
393
|
+
const line = viewer.entities.add({
|
|
394
|
+
polyline: {
|
|
395
|
+
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
|
|
396
|
+
117.332, 31.870, 17,
|
|
397
|
+
117.310, 31.870, 14,
|
|
398
|
+
117.282, 31.863, 23,
|
|
399
|
+
// ...省略中间控制点
|
|
400
|
+
117.139, 31.837, 39,
|
|
401
|
+
]),
|
|
402
|
+
width: 7,
|
|
403
|
+
material: new ANOVGIS.DaoHangLineMaterialProperty({
|
|
404
|
+
color1: Cesium.Color.WHITE,
|
|
405
|
+
color2: Cesium.Color.fromCssColorString('#0aed8b'),
|
|
406
|
+
whiteLength: 10.0,
|
|
407
|
+
greenLength: 40.0,
|
|
408
|
+
lineWidth: 0.45,
|
|
409
|
+
speed: 0,
|
|
410
|
+
}),
|
|
411
|
+
},
|
|
412
|
+
});
|
|
413
|
+
viewer.flyTo(line);
|
|
414
|
+
|
|
415
|
+
// 动态调参: 用 Object.assign 整体更新字段(不是重建 material)
|
|
416
|
+
apply(mat) {
|
|
417
|
+
Object.assign(line.polyline.material, {
|
|
418
|
+
color1: mat.color1, color2: mat.color2,
|
|
419
|
+
whiteLength: mat.whiteLength, greenLength: mat.greenLength,
|
|
420
|
+
lineWidth: mat.lineWidth, speed: mat.speed,
|
|
421
|
+
direction: mat.direction,
|
|
422
|
+
arrowLengthRatio: mat.arrowLengthRatio,
|
|
423
|
+
arrowWidthRatio: mat.arrowWidthRatio,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
<a id="water-shadertoy"></a>
|
|
429
|
+
### 水面 + 自定义 shadertoy(基于 Cesium 原生 Material)
|
|
430
|
+
|
|
431
|
+
> ⚠️ water 系列 4 个 demo **不是 ANOVGIS 自定义材质**,是 **Cesium 原生** `Cesium.Material` + `Cesium.GroundPrimitive`。开发者想自己写 GLSL 时参考。
|
|
432
|
+
|
|
433
|
+
#### water.html — 内置 Water Material
|
|
434
|
+
|
|
435
|
+
```js
|
|
436
|
+
// 来源: water.html L67-115
|
|
437
|
+
const coords = `116,39; 117,39; 117,40; 116,40; 116,39`;
|
|
438
|
+
ANOVGIS.LocateUtil.flyToPositions(viewer, coords, 0, -20, 1.0, 2, null);
|
|
439
|
+
|
|
440
|
+
const waterPrimitive = new Cesium.GroundPrimitive({
|
|
441
|
+
geometryInstances: new Cesium.GeometryInstance({ geometry: {} }),
|
|
442
|
+
asynchronous: true,
|
|
443
|
+
});
|
|
444
|
+
viewer.scene.groundPrimitives.add(waterPrimitive);
|
|
445
|
+
waterPrimitive.geometryInstances.geometry = new Cesium.PolygonGeometry({
|
|
446
|
+
polygonHierarchy: new Cesium.PolygonHierarchy(
|
|
447
|
+
ANOVGIS.Transform.transformWGS84ArrayToCartesianArray(ANOVGIS.Parse.parsePositions(coords)),
|
|
448
|
+
[]
|
|
449
|
+
),
|
|
450
|
+
height: 200, extrudedHeight: 100,
|
|
451
|
+
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
452
|
+
});
|
|
453
|
+
waterPrimitive.appearance = new Cesium.EllipsoidSurfaceAppearance({
|
|
454
|
+
translucent: true,
|
|
455
|
+
material: Cesium.Material.fromType('Water', {
|
|
456
|
+
normalMap: '../modelData/images/waterNormalsSmall.jpg',
|
|
457
|
+
frequency: 800.0, animationSpeed: 0.02, amplitude: 15.0,
|
|
458
|
+
specularIntensity: 0.8,
|
|
459
|
+
baseWaterColor: Cesium.Color.fromCssColorString('#006ab4').withAlpha(0.5),
|
|
460
|
+
blendColor: new Cesium.Color(1, 1, 1, 0.5),
|
|
461
|
+
}),
|
|
462
|
+
});
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
#### waterShadertoy.html — 自定义 fabric GLSL
|
|
466
|
+
|
|
467
|
+
```js
|
|
468
|
+
// 来源: waterShadertoy.html L53-195
|
|
469
|
+
// 关键: 自定义 uniform 命名带后缀(frequency_1 / baseWaterColor_4 等),
|
|
470
|
+
// 且配合自定义 fragmentShaderSource
|
|
471
|
+
ANOVGIS.LayerControlUitl.setSelectedTerrain(viewer, 2);
|
|
472
|
+
|
|
473
|
+
const wm = new Cesium.Material({
|
|
474
|
+
fabric: {
|
|
475
|
+
uniforms: {
|
|
476
|
+
specularMap_6: Cesium.Material.DefaultImageId,
|
|
477
|
+
normalMap_0: Cesium.buildModuleUrl('Assets/Textures/waterNormalsSmall.jpg'),
|
|
478
|
+
frequency_1: 1.0, animationSpeed_2: 0.01, amplitude_3: 10.0,
|
|
479
|
+
baseWaterColor_4: { x: 0, y: 0, z: 0.5, w: 1 },
|
|
480
|
+
blendColor_5: { x: 0, y: 0, z: 0.5, w: 0.5 },
|
|
481
|
+
specularIntensity_7: 1, fadeFactor_8: 1,
|
|
482
|
+
},
|
|
483
|
+
source: `
|
|
484
|
+
uniform sampler2D specularMap_6;
|
|
485
|
+
uniform sampler2D normalMap_0;
|
|
486
|
+
uniform vec4 baseWaterColor_4;
|
|
487
|
+
uniform vec4 blendColor_5;
|
|
488
|
+
uniform float frequency_1;
|
|
489
|
+
uniform float animationSpeed_2;
|
|
490
|
+
uniform float amplitude_3;
|
|
491
|
+
uniform float specularIntensity_7;
|
|
492
|
+
uniform float fadeFactor_8;
|
|
493
|
+
|
|
494
|
+
czm_material czm_getMaterial(czm_materialInput materialInput) {
|
|
495
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
496
|
+
float time = czm_frameNumber * animationSpeed_2;
|
|
497
|
+
vec4 noise = czm_getWaterNoise(normalMap_0, materialInput.st * frequency_1, time, 0.0);
|
|
498
|
+
vec3 normalTangentSpace = noise.xyz * vec3(1, 1, (1.0 / amplitude_3));
|
|
499
|
+
material.diffuse = mix(blendColor_5.rgb, baseWaterColor_4.rgb, noise.x);
|
|
500
|
+
material.alpha = mix(blendColor_5.a, baseWaterColor_4.a, noise.x);
|
|
501
|
+
material.specular = specularIntensity_7;
|
|
502
|
+
material.shininess = 10.0;
|
|
503
|
+
return material;
|
|
504
|
+
}
|
|
505
|
+
`,
|
|
506
|
+
},
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
viewer.scene.primitives.add(new Cesium.GroundPrimitive({
|
|
510
|
+
show: true,
|
|
511
|
+
classificationType: Cesium.ClassificationType.TERRAIN,
|
|
512
|
+
geometryInstances: new Cesium.GeometryInstance({
|
|
513
|
+
geometry: new Cesium.PolygonGeometry({
|
|
514
|
+
polygonHierarchy: new Cesium.PolygonHierarchy(
|
|
515
|
+
Cesium.Cartesian3.fromDegreesArrayHeights([116.383, 39.978, 100, 116.373, 39.977, 102, ...])
|
|
516
|
+
),
|
|
517
|
+
perPositionHeight: true, extrudedHeight: 100,
|
|
518
|
+
}),
|
|
519
|
+
}),
|
|
520
|
+
appearance: new Cesium.EllipsoidSurfaceAppearance({ material: wm }),
|
|
521
|
+
}));
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### cloud.html(Water Material 复用做云)
|
|
525
|
+
|
|
526
|
+
```js
|
|
527
|
+
// 来源: cloud.html L62-100
|
|
528
|
+
// 思路: Water Material 的"波纹 + 反射"恰好模拟云层外观,换不规则 coords 即可
|
|
529
|
+
const coords = `116.3879,40.0005; 116.3893,40.0006; 116.3900,39.9969;
|
|
530
|
+
116.3890,39.9968; 116.3883,39.9986; 116.3879,40.0005;`;
|
|
531
|
+
ANOVGIS.LocateUtil.flyToPositions(viewer, coords, 260, -20, 1.5, 3, null);
|
|
532
|
+
|
|
533
|
+
const waterPrimitive = new Cesium.GroundPrimitive({
|
|
534
|
+
geometryInstances: new Cesium.GeometryInstance({ geometry: {} }),
|
|
535
|
+
asynchronous: true,
|
|
536
|
+
});
|
|
537
|
+
viewer.scene.groundPrimitives.add(waterPrimitive);
|
|
538
|
+
waterPrimitive.geometryInstances.geometry = new Cesium.PolygonGeometry({
|
|
539
|
+
polygonHierarchy: new Cesium.PolygonHierarchy(
|
|
540
|
+
ANOVGIS.Transform.transformWGS84ArrayToCartesianArray(ANOVGIS.Parse.parsePositions(coords)), []
|
|
541
|
+
),
|
|
542
|
+
height: 0.1, vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
543
|
+
});
|
|
544
|
+
waterPrimitive.appearance = new Cesium.EllipsoidSurfaceAppearance({
|
|
545
|
+
material: Cesium.Material.fromType('Water', {
|
|
546
|
+
baseWaterColor: new Cesium.Color(0.2, 0.3, 0.6, 1),
|
|
547
|
+
blendColor: new Cesium.Color(0, 1, 0.7, 1),
|
|
548
|
+
specularMap: Cesium.Material.DefaultImageId,
|
|
549
|
+
normalMap: 'http://example.com/waterNormalsSmall.jpg',
|
|
550
|
+
frequency: 1000, animationSpeed: 0.01, amplitude: 10, specularIntensity: 10,
|
|
551
|
+
}),
|
|
552
|
+
});
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### waterShadertoy 变体 1(反射纹理) — `material/waterShadertoy1.html` L99-L174
|
|
556
|
+
|
|
557
|
+
```js
|
|
558
|
+
// 来源: waterShadertoy1.html L99-174
|
|
559
|
+
// 关键: 用 viewer.scene.captureSceneToFramebuffer() 抓取场景作为反射纹理 camT
|
|
560
|
+
// + 自定义 Material fabric uniforms
|
|
561
|
+
const miniMapTexture = viewer.scene.captureSceneToFramebuffer();
|
|
562
|
+
const wm = new Cesium.Material({
|
|
563
|
+
fabric: {
|
|
564
|
+
uniforms: {
|
|
565
|
+
camT: 'miniMapTexture', // 反射纹理
|
|
566
|
+
depthW: '../modelData/building/water/color.png', // 水深混合色
|
|
567
|
+
normalMap_0: 'http://.../water/waterNormalsSmall.jpg',
|
|
568
|
+
frequency_1: 1000.0, animationSpeed_2: 0.01, amplitude_3: 10.0,
|
|
569
|
+
baseWaterColor_4: { x: 0, y: 0, z: 0.5, w: 1 },
|
|
570
|
+
blendColor_5: { x: 0, y: 0, z: 0, w: 0.5 },
|
|
571
|
+
specularMap_6: '',
|
|
572
|
+
specularIntensity_7: 1, fadeFactor_8: 1,
|
|
573
|
+
C_position: BeijingPosition, C_normal: BeijingNormal,
|
|
574
|
+
},
|
|
575
|
+
source: `
|
|
576
|
+
uniform sampler2D camT;
|
|
577
|
+
uniform sampler2D depthW;
|
|
578
|
+
czm_material czm_getMaterial(czm_materialInput materialInput) {
|
|
579
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
580
|
+
vec2 reflectCoord = gl_FragCoord.xy / czm_viewport.zw;
|
|
581
|
+
vec2 reflectionTexcoord = vec2(1.0 - reflectCoord.x, reflectCoord.y);
|
|
582
|
+
material.diffuse = texture(camT, materialInput.st).rgb;
|
|
583
|
+
material.specular = specularIntensity_7;
|
|
584
|
+
material.shininess = 10.0;
|
|
585
|
+
return material;
|
|
586
|
+
}
|
|
587
|
+
`,
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
// 演示用 Primitive(非 GroundPrimitive) + EllipsoidSurfaceAppearance + 自定义 vertexShaderSource
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### waterShadertoy 变体 2(Blinn-Phong Specular) — `material/waterShadertoy2.html` L59-L107
|
|
594
|
+
|
|
595
|
+
```js
|
|
596
|
+
// 来源: waterShadertoy2.html L59-107
|
|
597
|
+
// 关键: 自定义 fabric type:'Specular',GLSL 实现 Blinn-Phong 漫反射 + 镜面反射
|
|
598
|
+
// 套到 entity.ellipsoid.material(球体 Entity)做演示
|
|
599
|
+
const specularMaterial = new Cesium.Material({
|
|
600
|
+
fabric: {
|
|
601
|
+
type: 'Specular',
|
|
602
|
+
uniforms: {
|
|
603
|
+
u_lightDirection: new Cesium.Cartesian3(0.5, 0.5, 0.5),
|
|
604
|
+
u_shininess: 50.0,
|
|
605
|
+
u_specularColor: new Cesium.Color(1, 1, 1, 1),
|
|
606
|
+
u_diffuseColor: new Cesium.Color(0.2, 0.2, 0.2, 1),
|
|
607
|
+
},
|
|
608
|
+
source: `
|
|
609
|
+
czm_material czm_getMaterial(czm_materialInput materialInput) {
|
|
610
|
+
vec3 normal = normalize(materialInput.normalEC);
|
|
611
|
+
vec3 viewDir = normalize(-materialInput.positionToEyeEC);
|
|
612
|
+
vec3 lightDir = normalize(u_lightDirection);
|
|
613
|
+
float diffuse = max(dot(lightDir, normal), 0.0);
|
|
614
|
+
vec3 reflectDir = reflect(-lightDir, normal);
|
|
615
|
+
float spec = pow(max(dot(viewDir, reflectDir), 0.0), u_shininess);
|
|
616
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
617
|
+
material.diffuse = u_diffuseColor.rgb * diffuse + u_specularColor.rgb * spec;
|
|
618
|
+
material.alpha = 1.0;
|
|
619
|
+
return material;
|
|
620
|
+
}
|
|
621
|
+
`
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
const ellipsoid = viewer.entities.add({
|
|
625
|
+
position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
|
|
626
|
+
ellipsoid: { radii: new Cesium.Cartesian3(10000, 10000, 10000), material: specularMaterial },
|
|
627
|
+
});
|
|
628
|
+
viewer.zoomTo(viewer.entities);
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
## 4. 关联阅读
|
|
632
|
+
|
|
633
|
+
- [`anovgis-pitfalls` P5](../anovgis-pitfalls/SKILL.md#p5-materialproperty) — MaterialProperty setter 模式(权威排查)
|
|
634
|
+
- [`anovgis-vector-graphics`](../anovgis-vector-graphics/SKILL.md) — `Vector` / `Primitive` / 原始图元体系(含 `ScanCirclePrimitive` / `DiffuseWallPrimitive` / `FlowLinePrimitive`)
|
|
635
|
+
- SDK `shader/` 目录:每个 Property 对应一个 `.glsl` 片段,shader 端改动后必须同步 `type/*.js` 注册
|