区域材质渲染
<h1>区域材质渲染</h1>
<h2>类与说明</h2>
<ol>
<li>
<p><strong>BCore.Extension.Effect.MaterialRegionEffectConfig</strong></p>
<ul>
<li><strong>说明</strong>: 材质区域特效配置参数</li>
<li><strong>构造</strong>:
<code>new BCore.Extension.Effect.MaterialRegionEffectConfig()</code></li>
</ul>
</li>
<li>
<p><strong>BCore.Extension.Effect.MaterialRegionEffectManagerConfig</strong></p>
<ul>
<li><strong>说明</strong>: 材质区域特效管理工具配置</li>
<li><strong>构造</strong>:
<code>new BCore.Extension.Effect.MaterialRegionEffectManagerConfig(Viewer3D)</code></li>
<li><strong>参数</strong>:
<code>viewer3D</code>: <code>BCore.Viewer.Viewer3D</code> - 三维模型视图对象</li>
</ul>
</li>
<li><strong>BCore.Extension.Effect.MaterialRegionEffectManager</strong>
<ul>
<li><strong>说明</strong>: 材质区域特效管理工具</li>
<li><strong>构造</strong>:
<code>new BCore.Extension.Effect.MaterialRegionEffectManager(config)</code></li>
<li><strong>参数</strong>:
<code>config</code>: <code>BCore.Extension.Effect.MaterialRegionEffectManagerConfig</code> - 材质区域特效管理工具配置</li>
</ul></li>
</ol>
<h2>BCore.Extension.Effect.MaterialRegionEffectConfig</h2>
<ul>
<li><strong>构造</strong>:
<code>new BCore.Extension.Effect.MaterialRegionEffectConfig()</code></li>
<li><strong>成员变量</strong>:
<ul>
<li><code>points</code>: <code>[{x:number,y:number}]</code> - 区域外轮廓</li>
<li><code>maxH</code>: <code>number</code> - 最高高度</li>
<li><code>minH</code>: <code>number</code> - 最低高度</li>
</ul></li>
</ul>
<h3>示例代码</h3>
<pre><code class="language-javascript">let regionmaterialConfig = new BCore.Extension.Effect.MaterialRegionEffectConfig();
regionmaterialConfig.points = [{x:0, y:0}, {x:-30, y:0}, {x:-15, y:-50}];
regionmaterialConfig.maxH = 20;
regionmaterialConfig.minH = 5; // 添加最低高度示例</code></pre>
<h2>BCore.Extension.Effect.MaterialRegionEffectManagerConfig</h2>
<ul>
<li><strong>构造</strong>: <code>new BCore.Extension.Effect.MaterialRegionEffectManagerConfig(Viewer3D)</code></li>
</ul>
<h2>BCore.Extension.Effect.MaterialRegionEffectManager 详情</h2>
<ul>
<li><strong>构造</strong>: <code>new BCore.Extension.Effect.MaterialRegionEffectManager(config)</code></li>
</ul>
<h3>添加材质区域效果</h3>
<ul>
<li><strong>简要描述</strong>: 添加材质区域效果,开启该功能时,需预先加载模型。</li>
<li><strong>接口</strong>:
<code>openMaterialRegion(materialRegionEffectConfig)</code></li>
<li><strong>参数</strong>:
<code>materialRegionEffectConfig</code>: <code>BCore.Extension.Effect.MaterialRegionEffectConfig</code> - 材质区域配置</li>
</ul>
<h4>示例代码</h4>
<pre><code class="language-javascript">let managerConfig = new BCore.Extension.Effect.MaterialRegionEffectManagerConfig(mViewer3D);
let regionmangager = new BCore.Extension.Effect.MaterialRegionEffectManager(managerConfig);
let regionconfig = new BCore.Extension.Effect.MaterialRegionEffectConfig();
regionmangager.openMaterialRegion(regionconfig);</code></pre>
<h3>移除材质区域效果</h3>
<ul>
<li><strong>简要描述</strong>: 移除材质区域效果。</li>
<li><strong>接口</strong>: <code>closeMaterialRegion()</code></li>
</ul>
<h4>示例代码</h4>
<pre><code class="language-javascript">regionmangager.closeMaterialRegion();</code></pre>
<hr />
<p>上述文档详细说明了区域材质渲染的相关类及其接口方法,提供了具体的构造方式和示例代码,帮助您更好地理解如何使用这些功能~</p>