当前位置: 首页 > news >正文

建一个团购网站wordpress 餐饮主题

建一个团购网站,wordpress 餐饮主题,太原网站制作企业,有人百度看片吗原理就是3dtiles里面的属性clippingPlanes 采用ClippingPlaneCollection#xff0c;构成多边形来挖洞。 其次就是xyz法向量挖洞 clippingPlanes: new this.ffCesium.Cesium.ClippingPlaneCollection({unionClippingRegions: true, // true 表示多个切割面能合并为一个有效的… 原理就是3dtiles里面的属性clippingPlanes 采用ClippingPlaneCollection构成多边形来挖洞。 其次就是xyz法向量挖洞 clippingPlanes: new this.ffCesium.Cesium.ClippingPlaneCollection({unionClippingRegions: true, // true 表示多个切割面能合并为一个有效的切割区域planes: [new this.ffCesium.Cesium.ClippingPlane(new this.ffCesium.Cesium.Cartesian3(0.0, 0.0, -1.0), // 法向量23.0 // 切割平面到原点的距离高度)] })以下是多边形裁剪 import * as Cesium from cesium class tileSetClipByPolygon {constructor(options) {this.tileSet options.tileSet || null //3dtiles this.originPositions options.originPositions || [] //点this.unionClippingRegions !options.unionClippingRegions ? options.unionClippingRegions : truethis.enabled !options.enabled ? options.enabled : truethis.edgeColor options.edgeColor || Cesium.Color.WHITEthis.edgeWidth options.edgeWidth || 0.0}isClockwise(polygon) {var area 0var length polygon.lengthfor (var i 0; i length; i) {var j (i 1) % lengtharea polygon[i][0] * polygon[j][1] - polygon[j][0] * polygon[i][1]}return area 0}getInverseTransform() {let transformlet tmp this.tileSet.root.transformif ((tmp tmp.equals(Cesium.Matrix4.IDENTITY)) || !tmp) {// 如果root.transform不存在则3DTiles的原点变成了boundingSphere.centertransform Cesium.Transforms.eastNorthUpToFixedFrame(this.tileSet.boundingSphere.center)} else {transform Cesium.Matrix4.fromArray(this.tileSet.root.transform)}return Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4())}clippingByPositions(clipping) {// debuggerconsole.log(this.tileSet, this.tileSet)this.tileSet.clippingPlanes nullconst Cartesian3 Cesium.Cartesian3const pointsLength clipping.lengthconst clockwise this.isClockwise(clipping)//所有的裁切面const clippingPlanes []let positionsif (clockwise) {//如果为逆则需要对数组取反positions clipping.reverse()} else {positions clipping}positions clippingconst inverseTransform this.getInverseTransform()for (let i 0; i pointsLength; i) {const nextIndex (i 1) % pointsLengthconst next Cesium.Matrix4.multiplyByPoint(inverseTransform, Cesium.Cartesian3.fromDegrees(positions[nextIndex][0], positions[nextIndex][1]), new Cesium.Cartesian3())const now Cesium.Matrix4.multiplyByPoint(inverseTransform, Cesium.Cartesian3.fromDegrees(positions[i][0], positions[i][1]), new Cesium.Cartesian3())// 定义一个垂直向上的向量uplet up new Cesium.Cartesian3(0, 0, 10)//得到指向下一个点的向量let right Cartesian3.subtract(next, now, new Cartesian3())right Cartesian3.normalize(right, right)let normal Cartesian3.cross(right, up, new Cartesian3())Cartesian3.normalize(normal, normal)//将法向量进行反向if (this.unionClippingRegions) {Cartesian3.negate(normal, normal)}//由于已经获得了法向量和过平面的一点因此可以直接构造Plane,并进一步构造ClippingPlanelet planeTmp Cesium.Plane.fromPointNormal(now, normal)const clipPlane Cesium.ClippingPlane.fromPlane(planeTmp)clippingPlanes.push(clipPlane)}let the thisconst clipPlanes new Cesium.ClippingPlaneCollection({planes: clippingPlanes,edgeWidth: the.edgeColor,edgeColor: the.edgeColor,enabled: the.enabled,unionClippingRegions: the.unionClippingRegions})console.log(clipPlanes, clipPlanes)this.tileSet.clippingPlanes clipPlanes}removeTilesetClip() {this.tileSet.clippingPlanes.enabled false} } export default tileSetClipByPolygon使用 this.CeiumPolygonClipA new CeiumPolygonClip({tileSet: photographyTileset.value,originPositions: clipping,unionClippingRegions: false})this.CeiumPolygonClipA.clippingByPositions(clipping) 在 CesiumJS 中ClippingPlane 和 ClippingPlaneCollection 通常用于控制哪些部分的场景或模型是可见的。通过切割面ClippingPlanes你可以裁剪或隐藏指定区域的内容。clippingPlanes 主要应用于以下几种对象 1. 3D Tiles 3D Tiles 是一种用于存储和传输大规模 3D 场景的格式它可以通过 clippingPlanes 进行裁剪。这是一个非常常见的应用尤其是在城市建模和大规模场景可视化中。 clippingPlanes 可以直接应用于 Cesium3DTileset 对象以裁剪掉 3D Tiles 模型的一部分。 示例 const tileset viewer.scene.primitives.add(new Cesium.Cesium3DTileset({url: path/to/your/3dtiles/tileset.json,clippingPlanes: new Cesium.ClippingPlaneCollection({planes: [new Cesium.ClippingPlane(Cesium.Cartesian3.UNIT_Z, 100.0)]}) }));在这个例子中Cesium3DTileset 会被切割只显示离 Z 轴 100 单位以内的区域。 2. Primitive原始几何体 clippingPlanes 也可以用于 Primitive 对象如几何体、模型等这是最基础的 3D 对象类型。通过将 ClippingPlaneCollection 赋值给 Primitive可以在渲染时裁剪它的几何体。 这种方法适用于自定义的几何体或其他静态几何体例如球体、立方体等。 示例 const sphereGeometry new Cesium.SphereGeometry({radius: 100.0 });const sphere new Cesium.Primitive({geometryInstances: new Cesium.GeometryInstance({geometry: sphereGeometry,modelMatrix: Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0.0, 0.0, 0.0)),}),appearance: new Cesium.MaterialAppearance({material: Cesium.Material.fromType(Color, {color: Cesium.Color.RED})}),clippingPlanes: new Cesium.ClippingPlaneCollection({planes: [new Cesium.ClippingPlane(Cesium.Cartesian3.UNIT_Z, 50.0) // 裁剪半径为 50 的球体]}) });viewer.scene.primitives.add(sphere);在这个例子中创建了一个球体并将其裁剪裁剪面距离原点 50 单位隐藏球体超过该高度的部分。 3. Models3D 模型 ClippingPlanes 也可以应用于 3D 模型如 glTF 模型。在 Cesium.Model 中clippingPlanes 可以用来裁剪模型的一部分。 示例 const model viewer.scene.primitives.add(Cesium.Model.fromGltf({url: path/to/your/model.glb,clippingPlanes: new Cesium.ClippingPlaneCollection({planes: [new Cesium.ClippingPlane(Cesium.Cartesian3.UNIT_Z, 50.0)]}) }));这段代码将对加载的 glTF 模型应用切割面裁剪掉离 Z 轴 50 单位以上的部分。 4. Terrain地形 对于 Cesium 中的地形数据例如使用 3D Tiles 数据源的地形可以通过切割面进行裁剪。地形通常是通过 Cesium.CesiumTerrainProvider 加载的而切割面可以用来限制地形的显示。 这种应用场景通常适用于大规模的地形可视化用户可以通过切割面查看地形的特定部分或从不同的切割角度进行分析。 5. Imagery影像图层 clippingPlanes 还可以用于影像图层特别是当你想要切割或限制影像图层的显示时。通过使用 clippingPlanes你可以将某些区域的影像数据裁剪掉以使其他数据更加突出。 示例 const imageryLayer viewer.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider({url : https://your-imagery-url/{z}/{x}/{y}.png }));imageryLayer.clippingPlanes new Cesium.ClippingPlaneCollection({planes: [new Cesium.ClippingPlane(Cesium.Cartesian3.UNIT_Z, 100.0)] });在这个例子中影像图层会被切割只显示离 Z 轴 100 单位以内的部分。 其他可能的应用场景 Skybox天空盒 clippingPlanes 也可用于裁剪 天空盒这在某些需要动态裁剪天空内容的应用中有用。 Custom Primitives自定义原始几何体 如果你自己创建了自定义几何体可以通过 clippingPlanes 使其进行裁剪减少计算负担或者实现特定的可视化效果。 Ground Clipping (地面裁剪) 对于需要动态控制地面显示的场景clippingPlanes 可以用来裁剪地面或者将其与其他场景元素进行交互。 总结 ClippingPlanes 在 Cesium 中是一个非常灵活的工具可以应用于以下对象 3D Tiles如城市模型Primitives如几何体Models如 glTF 模型Terrain地形Imagery影像图层Skybox天空盒Custom Primitives自定义几何体 这些对象可以通过 ClippingPlaneCollection 结合多个切割面来实现不同的裁剪效果从而动态地控制场景中的可见部分。
http://www.hkea.cn/news/14422043/

相关文章:

  • 株洲做网站 省心磐石网络从留言板开始做网站
  • 新密做网站徐州网站开发公司
  • 摄影作品欣赏网站推荐wordpress商城查件
  • 商丘网站建设哪家好jsp网站开发
  • 辽宁省建设银行e护航网站如果建设网站
  • 做网站一定要公司备案吗济宁网站建设公司有哪些
  • 做网站的步骤的文本wordpress电子书插件
  • 从事电子商务的网站建设做视频自媒体要投稿几个网站
  • 凡科做的网站手机版wordpress外链批量保存本地
  • 湖南省住房和城乡建设厅老网站免费照片的网站模板
  • 法律网站建设百度网盘账号登录入口
  • 精美手机网站模板网站素材 按钮
  • php购物网站开发成品asp.net网站开发代码
  • 安康创宇网站制作建设做旅游网站包括哪些栏目
  • 用网站的源代码怎么做网站沈阳鸿晟服装有限公司的案例
  • 服务器做jsp网站教程视频wordpress 表格不显示线
  • 文登市住房和城乡建设局网站wordpress拖拽式建站主题
  • 品牌宝免费网站163k地方门户网站系统
  • 有谁想做网站 优帮云东莞网站建设营销的企业
  • 中国建设银行网站主页知名网站欣赏
  • 常州网站建设企业网站制作织梦与wordpress详细比较
  • 公司网站怎么备案网站建设礻首选金手指
  • 龙岩网站建设设计服务淄博教育学校网站建设
  • 做网站主机要选好wordpress如何qq登录界面
  • 秦皇岛网站制作天元建设集团有限公司刘士龙
  • 东莞seo建站推广费用网站集约化建设纪要
  • 建筑工程网免费下载沈阳网站排名seo
  • 厦门 网站设计网站可信认证
  • 网站运行环境建设方案平面设计机构培训
  • 店铺只做商品展示网站怎么做怎么在网站后台加框框