cesium cesium3dtileset e3d支持什么格式式

PolylineGraphics
new Cesium.PolylineGraphics(options)
Describes a polyline defined as a line strip. The first two positions define a line segment,
and each additional position defines a line segment from the previous position. The segments
can be linear connected points or great arcs.
Description
Object with the following properties:
Description
A Property specifying the array of
positions that define the line strip.
followSurface
A boolean Property specifying whether the line segments should be great arcs or linearly connected.
A numeric Property specifying the width in pixels.
A boolean Property specifying the visibility of the polyline.
Color.WHITE
A Property specifying the material used to draw the polyline.
depthFailMaterial
A property specifiying the material used to draw the polyline when it is below the terrain.
granularity
Cesium.Math.RADIANS_PER_DEGREE
A numeric Property specifying the angular distance between each latitude and longitude if followSurface is true.
ShadowMode.DISABLED
An enum Property specifying whether the polyline casts or receives shadows from each light source.
distanceDisplayCondition
A Property specifying at what distance from the camera that this polyline will be displayed.
readonlydefinitionChanged :
Gets the event that is raised whenever a property or sub-property is changed or modified.
depthFailMaterial :
Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.
Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
there may be artifacts.
distanceDisplayCondition :
Gets or sets the
Property specifying at what distance from the camera that this polyline will be displayed.
followSurface :
Gets or sets the boolean Property specifying whether the line segments
should be great arcs or linearly connected.
granularity :
Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if followSurface is true.
Cesium.Math.RADIANS_PER_DEGREE
material :
Gets or sets the Property specifying the material used to draw the polyline.
Color.WHITE
positions :
Gets or sets the Property specifying the array of
positions that define the line strip.
Get or sets the enum Property specifying whether the polyline
casts or receives shadows from each light source.
ShadowMode.DISABLED
Gets or sets the boolean Property specifying the visibility of the polyline.
Gets or sets the numeric Property specifying the width in pixels.
clone(result) &
Duplicates this instance.
Description
The object onto which to store the result.
The modified result parameter or a new instance if one was not provided.
merge(source)
Assigns each unassigned property on this object to the value
of the same property on the provided source object.
Description
The object to be merged into this object.
Documentation generated by他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)new Cesium.Animation(container, viewModel)
Animation widget
The Animation widget provides buttons for play, pause, and reverse, along with the
current time and date, surrounded by a "shuttle ring" for controlling the speed of animation.
The "shuttle ring" concept is borrowed from video editing, where typically a
"jog wheel" can be rotated to move past individual animation frames very slowly, and
a surrounding shuttle ring can be twisted to control direction and speed of fast playback.
Cesium typically treats time as continuous (not broken into pre-defined animation frames),
so this widget offers no jog wheel.
Instead, the shuttle ring is capable of both fast and
very slow playback.
Click and drag the shuttle ring pointer itself (shown above in green),
or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.
The Animation widget also provides a "realtime" button (in the upper-left) that keeps
animation time in sync with the end user's system clock, typically displaying
"today" or "right now."
This mode is not available in
mode if the current time is outside of 's startTime and endTime.
Description
The DOM element or ID that will contain the widget.
The view model used by this widget.
: Element with id "container" does not exist in the document.
// In HTML head, include a link to Animation.css stylesheet,
// and in the body, include: &div id="animationContainer">&/div>
var clock = new Cesium.Clock();
var clockViewModel = new Cesium.ClockViewModel(clock);
var viewModel = new Cesium.AnimationViewModel(clockViewModel);
var widget = new Cesium.Animation('animationContainer', viewModel);
function tick() {
clock.tick();
Cesium.requestAnimationFrame(tick);
Cesium.requestAnimationFrame(tick);
readonlycontainer : Element
Gets the parent container.
readonlyviewModel :
Gets the view model.
applyThemeChanges()
Updates the widget to reflect any modified CSS rules for theming.
//Switch to the cesium-lighter theme.
document.body.className = 'cesium-lighter';
animation.applyThemeChanges();
Destroys the animation widget.
Should be called if permanently
removing the widget from layout.
isDestroyed() & Boolean
true if the object has been destroyed, false otherwise.
Resizes the widget to match the container size.
This function should be called whenever the container size is changed.
Documentation generated by1913人阅读
&&&&& Cesium在2016年3月份左右推出3D Tiles数据规范,在glTF基础上提供了LOD能力,定位就是Web环境下海量三维模型数据。虽然目前3D Tiles还是Beta阶段,有不少硬伤,但3D Tiles数据规范于日开始了OGC标准化进程,积极成分还是很大。
&&&&& 之前的glTF时分享了个人对二进制格式的一些想法和谨慎的态度。3D Tiles简单说就是具备LOD能力的glTF。有了数据首先是提供API可以渲染,保证用起来,下一步就要了解该数据规范的具体特点,比如倾斜,矢量,点云,OSM等支持情况,项目实施和风险评估等。最后,作为一个数据规范,从数据生产到深层次应用,需要时间沉淀出完善丰富的解决方案。
&&&&& 本文主要集中在渲染调度层面。看完本文可能会觉得思路很简单。在实际应用中有很多细节,比如浏览时各种操作的差异,并发量,内存和显存管理,异步传输和Workers线程等等各种调优。思路简单,但要把这些小细节打磨好就不容易了。本文只讲诗和远方,鞋里的沙子自己来处理吧。
&&&&& 先看看如何加载3D Tiles数据,如上所示,Cesium提供了Cesium3DTileset类来管理,主要负责Tile的调度。在Cesium中,3DTiles就相当于一个Primitive的位置。
3D Tile表述
&&&&& 当我们创建一个Cesium3DTileset后,每一个Tile对应一个Cesium3DTile。如上根节点是root,content是根节点对应的文件名,这里是parent.b3dm,四个子节点,子节点对应的文件名分别为ll.b3dm……。
&&&&& 如上,在获取JSON对象后,首先创建rootTile根节点,然后在while循环中,以广度优先的方式遍历这个树,每个节点都有一个parentTile属性绑定父节点(根节点除外),同时有一个children数组,保存该节点对应的所有子节点。
&&&&& 这样,在初始化阶段,Cesium3DTileset中就保存了该3DTiles树上的所有节点及关联,当然此时只是属性信息,并没有加载数据内容,所以内存上还是可以接受。这就相当于我们读书,都会先看这本书的目录,了解一个大概。但个人认为,第一,没必要,实际上只需要找到根节点,下面按需顺藤摸瓜就可以(JSON在搜索节点上很麻烦);第二,如果数据量很大的情况下,初次加载全部节点是一个性能瓶颈。这是3D
Tiles目前设计上的不足。
&&&&&& Cesium3DTile中通过一个简单的Cesium3DTileContentFactory工厂模式,目前主要提供四种类型。根据当前数据的具体类型(Type)来创建对应的内容(Content),本篇不涉及这块。初始化结束后,和之前glTF或primitive一样,基于状态的驱动流程:
&&&&& 如上是调度管理的逻辑,四个函数的作用大概如下:
processTiles
处理Tile对应的DrawCommand状态,判断一些半透明等渲染顺序
selectTiles
请求具体的b3dm数据,不同Type根据对应的类来完成数据的下载,根据LOD策略决定哪些Tile进入渲染队列。
updateTiles
当前帧状态下遍历这棵树,调用该Tile对应的Model::update,完成数据的解析最终构造出DrawCommand
unloadTiles
判断当前Tiles数目是否超过上限,卸载多余的Tile
&&&&& 在selectTiles函数中,首先是下载Tile对应的数据内容(b3dm后缀),通过contentUnloaded标识来判断,如果根节点的数据还没有下载,则request,然后返回。
&&&&& 一个简单的request,里面的信息量其实也不小,调用对应Cesium3DTile和Content对应的request来下载数据,这这里Cesium专门封装了一个RequestScheduler类来管理并发,我们最后在介绍这个。这里注意,当该数据下载完成后,则添加到两个队列:processQueue和removeQueue。
&&&&& 在Key2中,就是一个LOD策略的实现,上图给出了追加的逻辑注释。Cesium目前支持两种方式Add追加和Replace替换两种方式。Add方式较为简单,是Tiles求并的思路,而Replace是覆盖的思路,较为复杂,因为要控制父子节点直接的可见不可见,从代码来看,Cesium在这一块处理的比较简单,应该会出现闪烁的效果,不知道是否有人可以证实这个推测是否正确?
&&&&& UpdateTiles看上去就比较简单了,指定具体的Content..update,这个过程就是之前Pimitive和Model对应的update。
&&&&& 对于可以卸载的Tile,则满足条件后调用unloadContent,但个人觉得这块设计的还是有些疑虑。首先,设计的很不错,从Content到BatchTable,到Model,以及Texture都提供了destory方法,但纹理还是应该提供纹理管理器的概念,解决重用纹理的释放。
&&&&& 让我学到的一点就是RequestScheduler类,大概思路是规定每次并发的最大请求数,每一帧收集下载请求但并不发送该请求,在下一帧对请求队列排序(相机远近),然后再发送。实现的很巧妙,方便管理。毕竟在海量数据下,有这样一个Manager来控制是很有必要的。
&&&&& 问题比较大的地方是删除上(因为没有大数据测试,仅从代码逻辑猜测)。第一,update和select两个都是异步或者workers线程机制,在数据量比较大的情况下会有内存泄漏。第二,Replace队列无脑删除,并不是根据当前的范围和LOD,这个在设计上是一个很大的缺陷,只考虑了可见不可见,但没有优化删除策略。
&&&&& 总体来说,作为一个开源项目,3D Tiles迈出了很坚实的一步,数据规范设计的很优雅,基于glTF也降低了学习成本。同时Cesium提供了渲染3D Tiles的接口,稍显不足的就是还没有成熟的,免费的数据生成工具,可以从osg转为3d tiles,这是目前最大的瓶颈。简单说,Cesium目前提供了基本技术和规范,但并没有提供完整的解决方案,同时还缺少基于3D Tiles的丰富的扩展和应用。当然,我们不能对一个开源项目要求苛刻,而且我相信,也希望Cesium后续后慢慢完善,前面把路走踏实了,慢一点都可以接受,路遥知马力,踏踏实实做事情方能立本,本立而道生,在这个物欲横流的世界,这么简单的道理,其实并不简单。目前互联网能搜索到关于3d-tiles编译的学习资料有如下两个
看上去要弄好,似乎很复杂。确实如此,如下图。看到这些错误一脸蒙圈。
不知道是网络原因,还是其他原因,从ERR有一个内存不足。果断关闭一些进程。
测试编译好的成果,如下:
&3d-tiles加载的代码:
&&& viewer.scene.primitives.add(new Cesium.Cesium3DTileset({&&&&&&& url: 'https://cesiumjs.org/NewYork/3DTilesGml'&&& }));&&& viewer.camera.flyTo({&&&&&&& destination: Cesium.Cartesian3.fromDegrees(-73.3, 500.0),&&&&&&& orientation: {&&&&&&&&&&& heading: Cesium.Math.toRadians(175.0),&&&&&&&&&&& pitch: Cesium.Math.toRadians(-10.0),&&&&&&&&&&& roll: 0.0&&&&&&& },&&&&&&& //duration: 1&&& });
&3d-tiles加载后显示的效果
1、npm下载包需要网络条件非常好(是指可以访问国外某些健康的网站)
2、npm编译cesium似乎没有第一个那么复杂,但提供了思路
3、cesium显示3d-tiles数据格式,是需要下载对应的3d-tiles分支版本,期待早日合并
4、由于中间出现错误,使用的命令依次是
npm install gulp -g
npm install
npm run release
按顺序执行一边,应该可以看到预期效果
5、npm编译过程几乎内存占完,CPU卡死,需要一台好机器
阅读(...) 评论()}

我要回帖

更多关于 unity支持的3d格式 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信