国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

vue中加載使用cesium加載3dTileset以及三維模型移動(dòng)(1.108版本)

這篇具有很好參考價(jià)值的文章主要介紹了vue中加載使用cesium加載3dTileset以及三維模型移動(dòng)(1.108版本)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

cesium加載3dTileset代碼如下

   palaceTileset = await Cesium.Cesium3DTileset.fromUrl(
        "url", {
            skipLevelOfDetail: true,
            baseScreenSpaceError: 1024,
            skipScreenSpaceErrorFactor: 16,
            skipLevels: 1,
            immediatelyLoadDesiredLevelOfDetail: false,
            loadSiblings: false,
            cullWithChildrenBounds: true,
            progressiveResolutionHeightFraction: 1,
            dynamicScreenSpaceErrorDensity: 1,
            maximumScreenSpaceError: 1
        });
    viewer.scene.primitives.add(palaceTileset);

加載三維模型 視頻參考地址:
https://www.bilibili.com/video/BV14g411s7DX/?spm_id_from=333.1007.top_right_bar_window_history.content.click&vd_source=4716b12357fe8e4b33b293b4bbbbfcd8文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-818076.html

const initThreeModel = async () => {
    let res = await queryTrajectory(monitoringStore.$state.trajectoryId)
    let newArray = res.data.map(item => [item.longitude, item.latitude, item.heightValue]);
	//其中newArray中的參數(shù)為[ [117.4603186710001, 31.14388249900003, 15.147400000001653]]分別是經(jīng)緯度以及高度
    var viewer = new Cesium.Viewer("cesiumContainer", {
        //搜索框
        geocoder: false,
        //home鍵
        homeButton: false,
        // 動(dòng)畫(huà)控件
        animation: true,
        //全屏按鈕
        fullscreenButton: false,
        //場(chǎng)景模式選擇器
        sceneModePicker: false,
        //時(shí)間軸
        timeline: true,
        //導(dǎo)航提示
        navigationHelpButton: false,
        //地圖選擇器
        baseLayerPicker: false,
    })
    viewer.cesiumWidget.creditContainer.style.display = 'none'
    //創(chuàng)建DataSource
    var datasource = new Cesium.CustomDataSource("enetiestestdata");
    viewer.dataSources.add(datasource)
    let resImg = await reqQueryImgVideo(monitoringStore.$state.trajectoryId)
    let testArrayImg = resImg.data

    // 使用map方法遍歷數(shù)組并創(chuàng)建Billboard
    testArrayImg.map(function (item) {
        const position = Cesium.Cartesian3.fromDegrees(item.longitude, item.latitude);
        let testBillboard = viewer.entities.add({
            position: position,
            billboard: {
                image: 'https://img9.png',
                scale: 0.03, // 圖片縮放比例
                heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
            },
        });
        testBillboard.myCustomProperty = item.url
        // 注冊(cè)點(diǎn)擊事件
        viewer.screenSpaceEventHandler.setInputAction(function onLeftClick (movement) {
            var pickedObject = viewer.scene.pick(movement.position);
            if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id)) {
                var billboard = pickedObject.id;
                var description = billboard.myCustomProperty;
                imgurl.value=description
                checkDetail.value=true
                console.log('點(diǎn)擊了:' + description);
            }
        }, Cesium.ScreenSpaceEventType.LEFT_CLICK);

    });

    //添加線
    datasource.entities.add({
        name: "line",
        polyline: {
            positions: Cesium.Cartesian3.fromDegreesArrayHeights(newArray.flat()),
            material: Cesium.Color.MEDIUMSPRINGGREEN,
            width: 5
        }
    })

    var property = new Cesium.SampledPositionProperty();
    var starttime = new Date();
    var stoptime;
    var timestamp = starttime.getTime();

    newArray.forEach((pos, index) => {
        var time = new Date(timestamp + index * 5000);
        stoptime = time;
        var position = Cesium.Cartesian3.fromDegrees(pos[0], pos[1], pos[2])
        property.addSample(Cesium.JulianDate.fromDate(time), position);
    })
    property.setInterpolationOptions({
        interpolationDegree: 0.0001,
        interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
    });

    var entitydd = datasource.entities.add({
        availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
            start: Cesium.JulianDate.fromDate(starttime),
            stop: Cesium.JulianDate.fromDate(new Date(stoptime))
        })]),
        position: property, // 點(diǎn)集

        //開(kāi)啟模型自定義視角
        //orientation: new Cesium.VelocityOrientationProperty(property),
        model: {
            uri: '/uav-processed.glb',
            //uri: './scenewZ.glb',
            scale: 5,
            minimumPixelSize: 120,
            maximumScale: 500
        },
        path: {
            leadTime: 0,
            resolution: 1,
            material: new Cesium.PolylineGlowMaterialProperty({
                glowPower: 0.1,
                color: Cesium.Color.GREEN
            }),
            width: 10
        }
    });

    viewer.clock.currentTime = Cesium.JulianDate.fromDate(starttime); //修改時(shí)間軸的當(dāng)前時(shí)間
    viewer.clock.stopTime = Cesium.JulianDate.fromDate(new Date(stoptime));
    viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
    viewer.clock.shouldAnimate = true; //開(kāi)始播放
    viewer.zoomTo(datasource)
}

到了這里,關(guān)于vue中加載使用cesium加載3dTileset以及三維模型移動(dòng)(1.108版本)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Cesium3Dtilesets 使用customShader的解讀以及泛光效果示例

    Cesium3Dtilesets 使用customShader的解讀以及泛光效果示例

    前言:光帶原理在旋轉(zhuǎn)彈跳四棱錐這篇文章里早已經(jīng)闡述過(guò),但還是有不少靚仔靚女可能會(huì)感到疑惑,在3Dtilesets里怎么使用?為啥我在網(wǎng)上看到的為數(shù)不多的代碼示例我看不懂?是由于沒(méi)理解透徹導(dǎo)致的。借此機(jī)會(huì),提供一個(gè)小示例,從頭到尾的應(yīng)用一下。 效果 加載Cesium

    2024年01月20日
    瀏覽(15)
  • 【vue3.2+cesium】加載三維天地圖

    ? ? ? ? 使用Vite+Vue3.2+Cesium。Vite需要Node.js版本14.18+及以上版本。Vite命令創(chuàng)建的工程會(huì)自動(dòng)生成vite.config.js文件,來(lái)配置一些相關(guān)的參數(shù)。 1、使用Vite創(chuàng)建vue3項(xiàng)目 #? npm npm init vite@latest cesium-app -- --template vue #? yarn? yarn create vite cesium-app --template vue #? pnpm? pnpm create vite cesium

    2024年02月11日
    瀏覽(87)
  • 前端使用Cesium加載三維模型全攻略

    想象一下,地球在你眼前旋轉(zhuǎn),上面還有各種3D模型,是不是很酷?Cesium是一個(gè)超酷的庫(kù),專門用來(lái)創(chuàng)建超炫的3D地球和地圖。好,言歸正傳,今天這篇文章就分享一下前端如何使用Cesium加載三維模型。 首先,確保你已經(jīng)安裝了Cesium庫(kù)??梢詮腃esium官網(wǎng)下載最新版本的庫(kù)文件

    2024年04月17日
    瀏覽(96)
  • CesiumForUnreal實(shí)現(xiàn)多邊形裁剪3dTileset效果

    CesiumForUnreal實(shí)現(xiàn)多邊形裁剪3dTileset效果

    基于CesiumForUnreal插件的 Cartographic Polygon Actor在 Runtime 運(yùn)行時(shí)環(huán)境下實(shí)現(xiàn)對(duì)地形3DTileset的多邊形裁剪效果,GIF動(dòng)圖如下: 在Editor中的具體操作過(guò)程可以參考CesiumForUnreal官方裁剪地形的教程,本文這里在Runtime環(huán)境下進(jìn)行實(shí)現(xiàn)。數(shù)據(jù)依舊是使用CesiumForUnreal插件加載在線的地形和影

    2024年02月13日
    瀏覽(281)
  • CesiumForUnreal之3DTileset點(diǎn)選拾取屬性與單體高亮

    CesiumForUnreal之3DTileset點(diǎn)選拾取屬性與單體高亮

    在UE5中使用CesiumForUnreal插件加載本地的3dTiles建筑白模數(shù)據(jù),實(shí)現(xiàn)點(diǎn)擊拾取3DTileset單體要素的 屬性數(shù)據(jù) ,并對(duì) 高亮單體 進(jìn)行展示,GIF動(dòng)圖如下: 總體的實(shí)現(xiàn)過(guò)程分為 數(shù)據(jù)準(zhǔn)備 、 屬性拾取 和 單體高亮 三個(gè)大的部分,在本文中數(shù)據(jù)準(zhǔn)備部分簡(jiǎn)要概述,拾取屬性和單體高亮?xí)?/p>

    2024年02月04日
    瀏覽(50)
  • Cesium中加載地形影像切片,以及3dtiles和shp及kml方法

    Cesium中加載地形影像切片,以及3dtiles和shp及kml方法

    1geoserver影像服務(wù) 2加載cesiumlab切出的地形切片 3加載geotif 4加載geojson 5加載kml 6加載shp 效果1 ? ? 未完待續(xù)

    2024年02月11日
    瀏覽(20)
  • cesium加載三維模型3dtiles

    目的:為避免跨域 輸入cmd命令 python3 -m http.server 5500 http://127.0.0.1:5500/data/mars3d-max-shihua-3dtiles-master/tileset.json http://127.0.0.1:5500/cesium/cesium%E5%8A%A0%E8%BD%BD3dtile2.html

    2024年02月13日
    瀏覽(430)
  • vue中使用cesium 加載shp文件

    vue中使用cesium 加載shp文件

    在cesium中加載shp文件,將shp文件打包為zip,直接加載zip文件,shp文件中需包含這四個(gè)文件 加載代碼 ?

    2024年02月12日
    瀏覽(35)
  • 關(guān)于cesium中tif文件處理加載在三維地圖中得方式

    關(guān)于cesium中tif文件處理加載在三維地圖中得方式

    在Gis項(xiàng)目關(guān)于tif影像數(shù)據(jù)是不能直接在地圖上面加載,只能通過(guò)后端進(jìn)行處理,或者前端進(jìn)行處理之后才能疊加到地圖上面!

    2024年02月11日
    瀏覽(93)
  • 三維GIS開(kāi)發(fā):利用Cesium加載 M3D 地質(zhì)體模型(附代碼)

    三維GIS開(kāi)發(fā):利用Cesium加載 M3D 地質(zhì)體模型(附代碼)

    實(shí)現(xiàn)步驟 Step 1.? 引用開(kāi)發(fā)庫(kù) : 本示例引用 local 本地【include-cesium-local.js】開(kāi)發(fā)庫(kù),完成此步驟后才可調(diào)用三維 WebGL 的功能; Step 2.? 創(chuàng)建布局 : 創(chuàng)建 id=\\\'GlobeView\\\' 的 div 作為三維視圖的容器,并設(shè)置其樣式; Step 3.? 構(gòu)造三維場(chǎng)景控件 : 實(shí)例化 Cesium.WebSceneControl 對(duì)象,完成

    2024年02月10日
    瀏覽(86)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包