<!-- * @Author: your name * @Date: 2021-05-21 17:28:46 * @LastEditTime: 2021-06-16 10:02:30 * @LastEditors: Do not edit * @Description: In User Settings Edit * @FilePath: \Cesium-Examples\Examples\动态水面.html --> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> <title>primitive</title> <link href="../Build/Cesium/Widgets/widgets.css" rel="stylesheet" /> <script src="../Build/Cesium/Cesium.js"></script> <style> html, body, #cesiumContainer { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; } #trailer { position: absolute; bottom: 75px; right: 0; width: 320px; height: 180px; } </style> </head> <body> <div id="cesiumContainer"></div> <video id="trailer" muted="" autoplay="" loop="" crossorigin="" controls=""> <source src="https://cesium.com/public/SandcastleSampleData/big-buck-bunny_trailer.webm" type="video/webm"> <source src="https://cesium.com/public/SandcastleSampleData/big-buck-bunny_trailer.mp4" type="video/mp4"> <source src="https://cesium.com/public/SandcastleSampleData/big-buck-bunny_trailer.mov" type="video/quicktime"> Your browser does not support the <code>video</code> element. </video> <script> let osm = Cesium.createOpenStreetMapImageryProvider({ url: 'https://a.tile.openstreetmap.org/' }); let viewer = new Cesium.Viewer('cesiumContainer', { imageryProvider: osm, contextOptions: { webgl: { alpha: true } }, selectionIndicator: false, animation: false, //是否显示动画控件 baseLayerPicker: false, //是否显示图层选择控件 geocoder: false, //是否显示地名查找控件 timeline: false, //是否显示时间线控件 sceneModePicker: false, //是否显示投影方式控件 navigationHelpButton: false, //是否显示帮助信息控件 infoBox: false, //是否显示点击要素之后显示的信息 fullscreenButton: false }); var videoElement = document.getElementById("trailer"); let planyEntity = new Cesium.PlaneGraphics({ plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0),//指定平面的法线和距离 UNIT_Z代表方向,X,Y,Z,一般Z即可 // plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0),//指定平面的法线和距离 UNIT_Z代表方向,X,Y,Z,一般Z即可 // plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Y, 0),//指定平面的法线和距离 UNIT_Z代表方向,X,Y,Z,一般Z即可 dimensions: new Cesium.Cartesian2(300, 400),//指定宽度和高度 material: videoElement, }) let plane = viewer.entities.add({ position: new Cesium.Cartesian3.fromDegrees(140.0, 40.0, 0),//经纬度转笛卡尔 plane: planyEntity }) viewer.zoomTo(plane) </script> </body> </html>
正文
Cesium视频纹理
文章版权声明:除非注明,否则均为
譬如朝露_策温技术开发工作室博客原创文章,转载或复制请以超链接形式并注明出处。
发表评论
侧栏公告
寄语
譬如朝露博客是一个分享前端知识的网站,联系方式11523518。
热评文章
标签列表
热门文章
友情链接