@sl-utils/cesium 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE copy +201 -0
- package/README.md +5 -0
- package/demo/App.vue +26 -0
- package/demo/main.ts +5 -0
- package/demo/style.css +3 -0
- package/index.cjs +12 -0
- package/index.html +13 -0
- package/package.json +31 -3
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/public/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/public/Assets/Images/bing_maps_credit.png +0 -0
- package/public/Assets/Images/cesium_credit.png +0 -0
- package/public/Assets/Images/google_earth_credit.png +0 -0
- package/public/Assets/Images/ion-credit.png +0 -0
- package/public/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/public/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/public/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/public/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/public/Assets/Textures/maki/airfield.png +0 -0
- package/public/Assets/Textures/maki/airport.png +0 -0
- package/public/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/public/Assets/Textures/maki/america-football.png +0 -0
- package/public/Assets/Textures/maki/art-gallery.png +0 -0
- package/public/Assets/Textures/maki/bakery.png +0 -0
- package/public/Assets/Textures/maki/bank.png +0 -0
- package/public/Assets/Textures/maki/bar.png +0 -0
- package/public/Assets/Textures/maki/baseball.png +0 -0
- package/public/Assets/Textures/maki/basketball.png +0 -0
- package/public/Assets/Textures/maki/beer.png +0 -0
- package/public/Assets/Textures/maki/bicycle.png +0 -0
- package/public/Assets/Textures/maki/building.png +0 -0
- package/public/Assets/Textures/maki/bus.png +0 -0
- package/public/Assets/Textures/maki/cafe.png +0 -0
- package/public/Assets/Textures/maki/camera.png +0 -0
- package/public/Assets/Textures/maki/campsite.png +0 -0
- package/public/Assets/Textures/maki/car.png +0 -0
- package/public/Assets/Textures/maki/cemetery.png +0 -0
- package/public/Assets/Textures/maki/cesium.png +0 -0
- package/public/Assets/Textures/maki/chemist.png +0 -0
- package/public/Assets/Textures/maki/cinema.png +0 -0
- package/public/Assets/Textures/maki/circle-stroked.png +0 -0
- package/public/Assets/Textures/maki/circle.png +0 -0
- package/public/Assets/Textures/maki/city.png +0 -0
- package/public/Assets/Textures/maki/clothing-store.png +0 -0
- package/public/Assets/Textures/maki/college.png +0 -0
- package/public/Assets/Textures/maki/commercial.png +0 -0
- package/public/Assets/Textures/maki/cricket.png +0 -0
- package/public/Assets/Textures/maki/cross.png +0 -0
- package/public/Assets/Textures/maki/dam.png +0 -0
- package/public/Assets/Textures/maki/danger.png +0 -0
- package/public/Assets/Textures/maki/disability.png +0 -0
- package/public/Assets/Textures/maki/dog-park.png +0 -0
- package/public/Assets/Textures/maki/embassy.png +0 -0
- package/public/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/public/Assets/Textures/maki/entrance.png +0 -0
- package/public/Assets/Textures/maki/farm.png +0 -0
- package/public/Assets/Textures/maki/fast-food.png +0 -0
- package/public/Assets/Textures/maki/ferry.png +0 -0
- package/public/Assets/Textures/maki/fire-station.png +0 -0
- package/public/Assets/Textures/maki/fuel.png +0 -0
- package/public/Assets/Textures/maki/garden.png +0 -0
- package/public/Assets/Textures/maki/gift.png +0 -0
- package/public/Assets/Textures/maki/golf.png +0 -0
- package/public/Assets/Textures/maki/grocery.png +0 -0
- package/public/Assets/Textures/maki/hairdresser.png +0 -0
- package/public/Assets/Textures/maki/harbor.png +0 -0
- package/public/Assets/Textures/maki/heart.png +0 -0
- package/public/Assets/Textures/maki/heliport.png +0 -0
- package/public/Assets/Textures/maki/hospital.png +0 -0
- package/public/Assets/Textures/maki/ice-cream.png +0 -0
- package/public/Assets/Textures/maki/industrial.png +0 -0
- package/public/Assets/Textures/maki/land-use.png +0 -0
- package/public/Assets/Textures/maki/laundry.png +0 -0
- package/public/Assets/Textures/maki/library.png +0 -0
- package/public/Assets/Textures/maki/lighthouse.png +0 -0
- package/public/Assets/Textures/maki/lodging.png +0 -0
- package/public/Assets/Textures/maki/logging.png +0 -0
- package/public/Assets/Textures/maki/london-underground.png +0 -0
- package/public/Assets/Textures/maki/marker-stroked.png +0 -0
- package/public/Assets/Textures/maki/marker.png +0 -0
- package/public/Assets/Textures/maki/minefield.png +0 -0
- package/public/Assets/Textures/maki/mobilephone.png +0 -0
- package/public/Assets/Textures/maki/monument.png +0 -0
- package/public/Assets/Textures/maki/museum.png +0 -0
- package/public/Assets/Textures/maki/music.png +0 -0
- package/public/Assets/Textures/maki/oil-well.png +0 -0
- package/public/Assets/Textures/maki/park.png +0 -0
- package/public/Assets/Textures/maki/park2.png +0 -0
- package/public/Assets/Textures/maki/parking-garage.png +0 -0
- package/public/Assets/Textures/maki/parking.png +0 -0
- package/public/Assets/Textures/maki/pharmacy.png +0 -0
- package/public/Assets/Textures/maki/pitch.png +0 -0
- package/public/Assets/Textures/maki/place-of-worship.png +0 -0
- package/public/Assets/Textures/maki/playground.png +0 -0
- package/public/Assets/Textures/maki/police.png +0 -0
- package/public/Assets/Textures/maki/polling-place.png +0 -0
- package/public/Assets/Textures/maki/post.png +0 -0
- package/public/Assets/Textures/maki/prison.png +0 -0
- package/public/Assets/Textures/maki/rail-above.png +0 -0
- package/public/Assets/Textures/maki/rail-light.png +0 -0
- package/public/Assets/Textures/maki/rail-metro.png +0 -0
- package/public/Assets/Textures/maki/rail-underground.png +0 -0
- package/public/Assets/Textures/maki/rail.png +0 -0
- package/public/Assets/Textures/maki/religious-christian.png +0 -0
- package/public/Assets/Textures/maki/religious-jewish.png +0 -0
- package/public/Assets/Textures/maki/religious-muslim.png +0 -0
- package/public/Assets/Textures/maki/restaurant.png +0 -0
- package/public/Assets/Textures/maki/roadblock.png +0 -0
- package/public/Assets/Textures/maki/rocket.png +0 -0
- package/public/Assets/Textures/maki/school.png +0 -0
- package/public/Assets/Textures/maki/scooter.png +0 -0
- package/public/Assets/Textures/maki/shop.png +0 -0
- package/public/Assets/Textures/maki/skiing.png +0 -0
- package/public/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/public/Assets/Textures/maki/soccer.png +0 -0
- package/public/Assets/Textures/maki/square-stroked.png +0 -0
- package/public/Assets/Textures/maki/square.png +0 -0
- package/public/Assets/Textures/maki/star-stroked.png +0 -0
- package/public/Assets/Textures/maki/star.png +0 -0
- package/public/Assets/Textures/maki/suitcase.png +0 -0
- package/public/Assets/Textures/maki/swimming.png +0 -0
- package/public/Assets/Textures/maki/telephone.png +0 -0
- package/public/Assets/Textures/maki/tennis.png +0 -0
- package/public/Assets/Textures/maki/theatre.png +0 -0
- package/public/Assets/Textures/maki/toilets.png +0 -0
- package/public/Assets/Textures/maki/town-hall.png +0 -0
- package/public/Assets/Textures/maki/town.png +0 -0
- package/public/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/public/Assets/Textures/maki/triangle.png +0 -0
- package/public/Assets/Textures/maki/village.png +0 -0
- package/public/Assets/Textures/maki/warehouse.png +0 -0
- package/public/Assets/Textures/maki/waste-basket.png +0 -0
- package/public/Assets/Textures/maki/water.png +0 -0
- package/public/Assets/Textures/maki/wetland.png +0 -0
- package/public/Assets/Textures/maki/zoo.png +0 -0
- package/public/Assets/Textures/moonSmall.jpg +0 -0
- package/public/Assets/Textures/pin.svg +1 -0
- package/public/Assets/Textures/waterNormals.jpg +0 -0
- package/public/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/public/Assets/approximateTerrainHeights.json +1 -0
- package/public/Cesium.js +16587 -0
- package/public/ThirdParty/Workers/package.json +1 -0
- package/public/ThirdParty/Workers/zip-web-worker.js +1 -0
- package/public/ThirdParty/basis_transcoder.wasm +0 -0
- package/public/ThirdParty/draco_decoder.wasm +0 -0
- package/public/ThirdParty/google-earth-dbroot-parser.js +1 -0
- package/public/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/public/ThirdParty/zip-module.wasm +0 -0
- package/public/Widgets/Animation/Animation.css +127 -0
- package/public/Widgets/Animation/lighter.css +70 -0
- package/public/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/public/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/public/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/public/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/public/Widgets/CesiumWidget/CesiumWidget.css +119 -0
- package/public/Widgets/CesiumWidget/lighter.css +14 -0
- package/public/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/public/Widgets/Geocoder/Geocoder.css +70 -0
- package/public/Widgets/Geocoder/lighter.css +17 -0
- package/public/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
- package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/public/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/public/Widgets/Images/ImageryProviders/azureAerial.png +0 -0
- package/public/Widgets/Images/ImageryProviders/azureRoads.png +0 -0
- package/public/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/public/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/public/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/public/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/public/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/public/Widgets/Images/ImageryProviders/googleContour.png +0 -0
- package/public/Widgets/Images/ImageryProviders/googleRoadmap.png +0 -0
- package/public/Widgets/Images/ImageryProviders/googleSatellite.png +0 -0
- package/public/Widgets/Images/ImageryProviders/googleSatelliteLabels.png +0 -0
- package/public/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/public/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/public/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/public/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/public/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/public/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/public/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/public/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/public/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/public/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/public/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/public/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
- package/public/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/public/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/public/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/public/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/public/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/public/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/public/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/public/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- package/public/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/public/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/public/Widgets/Images/TimelineIcons.png +0 -0
- package/public/Widgets/Images/info-loading.gif +0 -0
- package/public/Widgets/InfoBox/InfoBox.css +92 -0
- package/public/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/public/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/public/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/public/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/public/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/public/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/public/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/public/Widgets/Timeline/Timeline.css +103 -0
- package/public/Widgets/Timeline/lighter.css +23 -0
- package/public/Widgets/VRButton/VRButton.css +8 -0
- package/public/Widgets/Viewer/Viewer.css +107 -0
- package/public/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/public/Widgets/lighter.css +237 -0
- package/public/Widgets/lighterShared.css +46 -0
- package/public/Widgets/shared.css +103 -0
- package/public/Widgets/widgets.css +1342 -0
- package/public/Workers/chunk-3DKU5AMY.js +26 -0
- package/public/Workers/chunk-3MO6V622.js +26 -0
- package/public/Workers/chunk-3ULTL2FZ.js +26 -0
- package/public/Workers/chunk-43YDDN2L.js +26 -0
- package/public/Workers/chunk-453UE67U.js +26 -0
- package/public/Workers/chunk-5JJC62LP.js +26 -0
- package/public/Workers/chunk-65WPDQMK.js +26 -0
- package/public/Workers/chunk-6J7K26F7.js +26 -0
- package/public/Workers/chunk-A3G5ORRJ.js +26 -0
- package/public/Workers/chunk-AIXDAWPZ.js +26 -0
- package/public/Workers/chunk-ANKVUFZB.js +26 -0
- package/public/Workers/chunk-AZ67KQQB.js +26 -0
- package/public/Workers/chunk-C5F5JZAC.js +26 -0
- package/public/Workers/chunk-CK62LO4L.js +26 -0
- package/public/Workers/chunk-DXDIQEOK.js +26 -0
- package/public/Workers/chunk-E7ZPYMUI.js +26 -0
- package/public/Workers/chunk-GDE4VUE6.js +26 -0
- package/public/Workers/chunk-GGYRJCFH.js +29 -0
- package/public/Workers/chunk-HBIOVTO5.js +27 -0
- package/public/Workers/chunk-HJIURIT6.js +26 -0
- package/public/Workers/chunk-IDLM42AV.js +26 -0
- package/public/Workers/chunk-IFBNVX3N.js +26 -0
- package/public/Workers/chunk-IR47TAV5.js +26 -0
- package/public/Workers/chunk-ISGFCDPW.js +26 -0
- package/public/Workers/chunk-JJ24SU25.js +26 -0
- package/public/Workers/chunk-LAGV6F3C.js +29 -0
- package/public/Workers/chunk-LLCMCKFU.js +26 -0
- package/public/Workers/chunk-MSR5BKMH.js +26 -0
- package/public/Workers/chunk-MWVHSLYS.js +26 -0
- package/public/Workers/chunk-MYNU3I3W.js +26 -0
- package/public/Workers/chunk-NSDLDP72.js +26 -0
- package/public/Workers/chunk-NUY3PECV.js +26 -0
- package/public/Workers/chunk-OHMLE6SB.js +26 -0
- package/public/Workers/chunk-OJH7UFER.js +28 -0
- package/public/Workers/chunk-OUZ34R6R.js +26 -0
- package/public/Workers/chunk-OWJWRYGM.js +26 -0
- package/public/Workers/chunk-PAML32O3.js +26 -0
- package/public/Workers/chunk-PNKG35NX.js +26 -0
- package/public/Workers/chunk-Q6F3SO7I.js +26 -0
- package/public/Workers/chunk-QROIA2H7.js +26 -0
- package/public/Workers/chunk-RH6XN2ZV.js +28 -0
- package/public/Workers/chunk-SCMY6ELS.js +26 -0
- package/public/Workers/chunk-SP3AH7D2.js +26 -0
- package/public/Workers/chunk-SRXN2PE4.js +26 -0
- package/public/Workers/chunk-SUBLUDWJ.js +26 -0
- package/public/Workers/chunk-T4S74O3D.js +26 -0
- package/public/Workers/chunk-TITUTZNR.js +63 -0
- package/public/Workers/chunk-UWS7N7FB.js +26 -0
- package/public/Workers/chunk-V5C26K4F.js +26 -0
- package/public/Workers/chunk-VAPRBQYE.js +26 -0
- package/public/Workers/chunk-VBYW5FXW.js +26 -0
- package/public/Workers/chunk-VLPLGYXT.js +26 -0
- package/public/Workers/chunk-W5T7UWKW.js +26 -0
- package/public/Workers/chunk-XLJBHQML.js +26 -0
- package/public/Workers/chunk-XWXQVSYW.js +26 -0
- package/public/Workers/chunk-YSN2K4FT.js +27 -0
- package/public/Workers/chunk-ZTSD53QT.js +26 -0
- package/public/Workers/combineGeometry.js +26 -0
- package/public/Workers/createBoxGeometry.js +26 -0
- package/public/Workers/createBoxOutlineGeometry.js +26 -0
- package/public/Workers/createCircleGeometry.js +26 -0
- package/public/Workers/createCircleOutlineGeometry.js +26 -0
- package/public/Workers/createCoplanarPolygonGeometry.js +26 -0
- package/public/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
- package/public/Workers/createCorridorGeometry.js +26 -0
- package/public/Workers/createCorridorOutlineGeometry.js +26 -0
- package/public/Workers/createCylinderGeometry.js +26 -0
- package/public/Workers/createCylinderOutlineGeometry.js +26 -0
- package/public/Workers/createEllipseGeometry.js +26 -0
- package/public/Workers/createEllipseOutlineGeometry.js +26 -0
- package/public/Workers/createEllipsoidGeometry.js +26 -0
- package/public/Workers/createEllipsoidOutlineGeometry.js +26 -0
- package/public/Workers/createFrustumGeometry.js +26 -0
- package/public/Workers/createFrustumOutlineGeometry.js +26 -0
- package/public/Workers/createGeometry.js +26 -0
- package/public/Workers/createGroundPolylineGeometry.js +26 -0
- package/public/Workers/createPlaneGeometry.js +26 -0
- package/public/Workers/createPlaneOutlineGeometry.js +26 -0
- package/public/Workers/createPolygonGeometry.js +26 -0
- package/public/Workers/createPolygonOutlineGeometry.js +26 -0
- package/public/Workers/createPolylineGeometry.js +26 -0
- package/public/Workers/createPolylineVolumeGeometry.js +26 -0
- package/public/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
- package/public/Workers/createRectangleGeometry.js +26 -0
- package/public/Workers/createRectangleOutlineGeometry.js +26 -0
- package/public/Workers/createSimplePolylineGeometry.js +26 -0
- package/public/Workers/createSphereGeometry.js +26 -0
- package/public/Workers/createSphereOutlineGeometry.js +26 -0
- package/public/Workers/createTaskProcessorWorker.js +26 -0
- package/public/Workers/createVectorTileClampedPolylines.js +26 -0
- package/public/Workers/createVectorTileGeometries.js +26 -0
- package/public/Workers/createVectorTilePoints.js +26 -0
- package/public/Workers/createVectorTilePolygons.js +26 -0
- package/public/Workers/createVectorTilePolylines.js +26 -0
- package/public/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -0
- package/public/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
- package/public/Workers/createVerticesFromHeightmap.js +26 -0
- package/public/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
- package/public/Workers/createWallGeometry.js +26 -0
- package/public/Workers/createWallOutlineGeometry.js +26 -0
- package/public/Workers/decodeDraco.js +26 -0
- package/public/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
- package/public/Workers/decodeI3S.js +26 -0
- package/public/Workers/gaussianSplatSorter.js +26 -0
- package/public/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/public/Workers/incrementallyBuildTerrainPicker.js +26 -0
- package/public/Workers/transcodeKTX2.js +56 -0
- package/public/Workers/transferTypedArrayTest.js +26 -0
- package/public/Workers/upsampleQuantizedTerrainMesh.js +26 -0
- package/public/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -0
- package/public/index.cjs +16587 -0
- package/public/index.js +16587 -0
- package/src/Assets/geojson/BaiYangDian.geojson +699 -0
- package/src/Assets/geojson/HeBei.geojson +97754 -0
- package/src/Assets/geojson//344/270/255/345/233/275_/347/234/201.geojson +1 -0
- package/src/Assets/images/BYD.png +0 -0
- package/src/Assets/images/BYH.png +0 -0
- package/src/Assets/images/CZD.png +0 -0
- package/src/Assets/images/bouys.png +0 -0
- package/src/Assets/images/hebei.ico +0 -0
- package/src/Assets/images/jinzhou.ico +0 -0
- package/src/Assets/images/map_bg.png +0 -0
- package/src/Assets/images/map_bridge.png +0 -0
- package/src/Assets/images/map_radar.png +0 -0
- package/src/Assets/images/map_vhf.png +0 -0
- package/src/Assets/images/shenlan.png +0 -0
- package/src/Assets/images/ship.png +0 -0
- package/src/Assets/images/ship_1.png +0 -0
- package/src/Assets/images/ship_1_e.png +0 -0
- package/src/Assets/images/ship_1_tv.png +0 -0
- package/src/Assets/images/ship_2.png +0 -0
- package/src/Assets/images/ship_2_e.png +0 -0
- package/src/Assets/images/ship_2_tv.png +0 -0
- package/src/Assets/images/ship_3.png +0 -0
- package/src/Assets/images/ship_3_e.png +0 -0
- package/src/Assets/images/ship_3_tv.png +0 -0
- package/src/Assets/images/ship_4.png +0 -0
- package/src/Assets/images/ship_4_e.png +0 -0
- package/src/Assets/images/ship_4_tv.png +0 -0
- package/src/Assets/images/ship_5.png +0 -0
- package/src/Assets/images/ship_5_e.png +0 -0
- package/src/Assets/images/ship_5_tv.png +0 -0
- package/src/Assets/images/snowflake_particle.png +0 -0
- package/src/Assets/models/fengche.gltf +2920 -0
- package/src/Assets/resource.ts +32 -0
- package/src/const/color.ts +10 -0
- package/src/const/config/camera.ts +16 -0
- package/src/const/config/index.ts +2 -0
- package/src/const/config/viewer.ts +42 -0
- package/src/const/index.ts +3 -0
- package/src/const/position.ts +34 -0
- package/src/core/cdk/compass.ts +24 -0
- package/src/core/cdk/index.ts +36 -0
- package/src/core/cdk/lnglat.ts +125 -0
- package/src/core/cdk/orbit.ts +118 -0
- package/src/core/cdk/overlay.ts +90 -0
- package/src/core/cdk/slider.ts +54 -0
- package/src/core/cdk/svg_compass.svg +33 -0
- package/src/core/index.ts +2 -0
- package/src/core/layers/baidu-map-layer.ts +117 -0
- package/src/core/libs/gui.ts +88 -0
- package/src/core/scene/camera.ts +211 -0
- package/src/core/scene/globe.ts +33 -0
- package/src/core/scene/index.ts +5 -0
- package/src/core/scene/layers.ts +240 -0
- package/src/core/scene/primitives.ts +55 -0
- package/src/core/scene/scene.ts +44 -0
- package/src/core/viewer/clock.ts +93 -0
- package/src/core/viewer/data.ts +17 -0
- package/src/core/viewer/element.ts +146 -0
- package/src/core/viewer/entities.ts +74 -0
- package/src/core/viewer/event.ts +155 -0
- package/src/core/viewer/index.ts +7 -0
- package/src/core/viewer/result.ts +7 -0
- package/src/core/viewer/terrain.ts +30 -0
- package/src/core/viewer/viewer.ts +255 -0
- package/src/entities/ellipse.ts +68 -0
- package/src/entities/geojson.ts +19 -0
- package/src/entities/image.ts +28 -0
- package/src/entities/index.ts +42 -0
- package/src/entities/label.ts +37 -0
- package/src/entities/point.ts +48 -0
- package/src/entities/polygon.ts +59 -0
- package/src/entities/polyline.ts +55 -0
- package/src/entities/radar.ts +18 -0
- package/src/entities/rectangle.ts +50 -0
- package/src/entities/trailing.ts +22 -0
- package/src/index.ts +10 -0
- package/src/plugins/bathymetry.ts +107 -0
- package/src/plugins/elevation.ts +146 -0
- package/src/plugins/index.ts +3 -0
- package/src/plugins/post-process-snow.glsl +99 -0
- package/src/plugins/post-process-snow.ts +45 -0
- package/src/plugins/thunder.glsl +159 -0
- package/src/primitives/appearance/demo.ts +27 -0
- package/src/primitives/appearance/index.ts +1 -0
- package/src/primitives/area.ts +40 -0
- package/src/primitives/geometry/geometry.ts +44 -0
- package/src/primitives/image-2d.ts +73 -0
- package/src/primitives/index.ts +9 -0
- package/src/primitives/instance/instance.ts +58 -0
- package/src/primitives/material/image2d.ts +25 -0
- package/src/primitives/material/index.ts +8 -0
- package/src/primitives/material/ship2d.ts +55 -0
- package/src/primitives/particle.ts +47 -0
- package/src/primitives/shaders/EllipsoidSurfaceAppearanceFS.glsl +31 -0
- package/src/primitives/shaders/EllipsoidSurfaceAppearanceVS.glsl +19 -0
- package/src/primitives/shaders/imageFS.glsl +22 -0
- package/src/primitives/shaders/raedme.md +187 -0
- package/src/property/index.ts +1 -0
- package/src/property/material/core.ts +52 -0
- package/src/property/material/index.ts +5 -0
- package/src/property/material/radar.ts +41 -0
- package/src/property/material/road.ts +35 -0
- package/src/property/material/trailing.ts +31 -0
- package/src/property/material/wall.ts +31 -0
- package/src/scene/TJG/area.ts +37 -0
- package/src/scene/TJG/billboard.ts +89 -0
- package/src/scene/TJG/entityies.ts +131 -0
- package/src/scene/TJG/lines.ts +14 -0
- package/src/scene/TJG/maps.ts +16 -0
- package/src/scene/TJG/scene-tjg.ts +212 -0
- package/src/scene/TJG/ships.ts +32 -0
- package/src/scene/TJG/tileset.ts +144 -0
- package/src/scene/TJG/tjg.d.ts +14 -0
- package/src/scene/cdk/fog.ts +47 -0
- package/src/scene/cdk/index.ts +4 -0
- package/src/scene/cdk/measure.ts +108 -0
- package/src/scene/cdk/plot.ts +182 -0
- package/src/scene/cdk/source.ts +33 -0
- package/src/shaders/3d-tileset.ts +41 -0
- package/src/shaders/index.ts +1 -0
- package/src/shaders/material-property/a-readme.md +2 -0
- package/src/shaders/material-property/radarFS.glsl +25 -0
- package/src/shaders/material-property/roadFS.glsl +14 -0
- package/src/shaders/material-property/trailingFS.glsl +18 -0
- package/src/shaders/material-property/wallFS.glsl +31 -0
- package/src/shaders/raedme.md +187 -0
- package/src/shaders/ship/ShipVS.glsl +19 -0
- package/src/sl-utils-cesium.ts +1 -0
- package/src/types/cdk.d.ts +20 -0
- package/src/types/core.d.ts +6 -0
- package/src/types/entity.d.ts +628 -0
- package/src/types/event.d.ts +32 -0
- package/src/types/extend.Cesium.d.ts +28 -0
- package/src/types/geometry.d.ts +55 -0
- package/src/types/plugins.d.ts +34 -0
- package/src/types/primitive.d.ts +69 -0
- package/src/types/scene.d.ts +25 -0
- package/src/types/viewer.d.ts +114 -0
- package/src/utils/cesium.ts +189 -0
- package/src/utils/common.ts +87 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/map.ts +112 -0
- package/src/utils/types.ts +44 -0
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +34 -0
- package/types/billboard.d.ts +8 -0
- package/types/entities.d.ts +224 -0
- package/types/property.d.ts +12 -0
- package/types/resource.d.ts +26 -0
- package/types/sl-utils-cesium.d.ts +17 -0
- package/vite.config.ts +43 -0
- package/webpack.config.js +29 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#define MAX_STEPS 200
|
|
2
|
+
#define MAX_DIST 1200.
|
|
3
|
+
#define SURF_DIST .1
|
|
4
|
+
|
|
5
|
+
// 原始场景的颜色纹理:Cesium渲染好的地球/模型/影像画面
|
|
6
|
+
uniform sampler2D colorTexture;
|
|
7
|
+
// 原始场景的深度纹理:记录每个像素的深度值(本代码未使用)
|
|
8
|
+
uniform sampler2D depthTexture;
|
|
9
|
+
// 纹理采样坐标:[0,1]范围,PostProcessStage自动传值,用于采样colorTexture
|
|
10
|
+
in vec2 v_textureCoordinates;
|
|
11
|
+
|
|
12
|
+
float iTime;
|
|
13
|
+
|
|
14
|
+
//生成 2D 旋转矩阵,用于旋转纹理坐标,减少分形噪声的轴向偏差
|
|
15
|
+
mat2 rot(float r){
|
|
16
|
+
return mat2(cos(r), sin(r), -sin(r), cos(r));
|
|
17
|
+
}
|
|
18
|
+
//为随机数sin取小数
|
|
19
|
+
float random(float x){
|
|
20
|
+
return fract(sin(x*323.9877));
|
|
21
|
+
}
|
|
22
|
+
//伪随机数sin取小数
|
|
23
|
+
float random (in vec2 _st) {
|
|
24
|
+
return fract( sin( dot( _st.xy,vec2(12.9898,78.233) ) )* 43758.5453123);
|
|
25
|
+
}
|
|
26
|
+
//伪随机数sin取小数 =》 [-1.5,0.5]
|
|
27
|
+
vec2 random2(vec2 _st){
|
|
28
|
+
vec2 res = vec2(
|
|
29
|
+
fract( sin( dot( _st.xy, vec2(12.9898,78.233) ) ) * 43758.5453123),
|
|
30
|
+
fract( sin( dot( _st.xy, vec2(45.9898,31.233) ) ) * 43758.5453123)
|
|
31
|
+
);
|
|
32
|
+
res-=.5;
|
|
33
|
+
return res;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
float noise (in vec2 _st) {
|
|
37
|
+
// 整数部分(瓷砖坐标)
|
|
38
|
+
vec2 i = floor(_st);
|
|
39
|
+
// 小数部分(瓷砖内坐标)
|
|
40
|
+
vec2 f = fract(_st);
|
|
41
|
+
// 采样瓷砖四个角的随机值
|
|
42
|
+
float a = random(i);
|
|
43
|
+
float b = random(i + vec2(1.0, 0.0));
|
|
44
|
+
float c = random(i + vec2(0.0, 1.0));
|
|
45
|
+
float d = random(i + vec2(1.0, 1.0));
|
|
46
|
+
// 平滑插值曲线(避免线性插值的硬边)
|
|
47
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
48
|
+
return mix(a, b, u.x) + (c - a)* u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#define NUM_OCTAVES 5
|
|
52
|
+
|
|
53
|
+
float fbm ( in vec2 _st) {
|
|
54
|
+
float v = 0.0;
|
|
55
|
+
float a = 0.5;
|
|
56
|
+
vec2 shift = vec2(100.0);
|
|
57
|
+
// Rotate to reduce axial bias
|
|
58
|
+
mat2 rot = mat2(cos(0.5), sin(0.5),
|
|
59
|
+
-sin(0.5), cos(0.50));
|
|
60
|
+
for (int i = 0; i < NUM_OCTAVES; ++i) {
|
|
61
|
+
v += a * noise(_st);
|
|
62
|
+
_st = rot * _st * 2.0 + shift;
|
|
63
|
+
a *= 0.5;
|
|
64
|
+
}
|
|
65
|
+
return v;
|
|
66
|
+
}
|
|
67
|
+
const mat2 m2 = mat2( 0.80, 0.60, -0.60, 0.80 );
|
|
68
|
+
|
|
69
|
+
float fbm_6(vec2 x){
|
|
70
|
+
float f = 2.0;
|
|
71
|
+
float s = 0.5;
|
|
72
|
+
float a = 0.0;
|
|
73
|
+
float b = 0.5;
|
|
74
|
+
for( int i=0; i<6; i++ )
|
|
75
|
+
{
|
|
76
|
+
float n = noise(x);
|
|
77
|
+
a += b*n;
|
|
78
|
+
b *= s;
|
|
79
|
+
x = f*m2*x;
|
|
80
|
+
}
|
|
81
|
+
return a;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
float dseg( vec2 ba, vec2 pa )
|
|
85
|
+
{
|
|
86
|
+
float h = clamp( dot(pa,ba)/dot(ba,ba),0., 1.6 );
|
|
87
|
+
return length( pa - ba*h );
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
float arc2(vec2 x,vec2 r, vec2 dir,float stepnum){
|
|
91
|
+
float d=10.;
|
|
92
|
+
for (float i = 0.; i < stepnum; i++)
|
|
93
|
+
{
|
|
94
|
+
vec2 s= normalize(random2(r)+dir);
|
|
95
|
+
d=min(d,dseg(s,x-r));
|
|
96
|
+
r += s;
|
|
97
|
+
}
|
|
98
|
+
return d;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
float arc(vec2 x,vec2 r, vec2 dir,float stepnum){
|
|
102
|
+
float d=10.;
|
|
103
|
+
for (float i = 1.; i < stepnum; i++){
|
|
104
|
+
vec2 s= normalize(random2(r)+dir);
|
|
105
|
+
d=min(d,dseg(s,x-r));
|
|
106
|
+
r += s;
|
|
107
|
+
if(mod(i,6.)==0.) d=min(d,arc2(x,r,vec2(0.25,-0.8),fract(iTime*1.4)*5.));
|
|
108
|
+
}
|
|
109
|
+
return d*4.;
|
|
110
|
+
}
|
|
111
|
+
//
|
|
112
|
+
//缩放影子 scale 越小闪电越大
|
|
113
|
+
//
|
|
114
|
+
float perlight(vec2 uv,float scale,float stepnum){
|
|
115
|
+
// sin结果小数值大于0.32时不生成光效( 0 - 2PI 节奏快-慢-快-慢 )
|
|
116
|
+
float t = fract( sin( iTime * 3.239877));
|
|
117
|
+
if( t > 0.32 ) return 0.;
|
|
118
|
+
vec2 or = vec2( 0.03, -0.043);
|
|
119
|
+
or = or + .01 * sin( or + .3 * iTime);
|
|
120
|
+
// x = [-0.5,0.5], y = [-1,0]
|
|
121
|
+
uv.y -= 0.5;
|
|
122
|
+
uv.x -= 0.5;
|
|
123
|
+
float res=exp( -1.8 * length(uv) )*0.7;
|
|
124
|
+
if(t > 0.06) return res*0.25;
|
|
125
|
+
uv*=scale;
|
|
126
|
+
uv.x+=fbm_6(-uv*2.4)*0.4;
|
|
127
|
+
uv.y+=fbm(uv*2.2)*.6;
|
|
128
|
+
float d=100.;
|
|
129
|
+
vec2 r=or*scale;
|
|
130
|
+
for(float i=0.;i<=stepnum;i++){
|
|
131
|
+
vec2 ab = normalize( random2(r) - vec2(0,0.5+fract(iTime*0.0000006))) * 0.8;
|
|
132
|
+
d=min(d, dseg(ab,uv-r));
|
|
133
|
+
r+=ab;
|
|
134
|
+
if(mod(i,6.)==floor(random(iTime*0.00001)*2.)+1.) d=min(d,arc(uv,r,vec2(0.65,-0.5),fract(iTime*1.4)*random(i)*12.));
|
|
135
|
+
if(mod(i,8.)==floor(random(iTime*0.00002)*1.)+1.) d=min(d,arc(uv,r,vec2(-0.67,-.5),fract(iTime*1.4)*random(i*3.)*12.));
|
|
136
|
+
}
|
|
137
|
+
return max(res,exp(-scale*0.15*d));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
void main()
|
|
141
|
+
{
|
|
142
|
+
//czm_frameNumber每渲一帧就+1,约一秒60帧, 该结果大约每秒完成一个三角函数周期
|
|
143
|
+
iTime = czm_frameNumber / 60.0 * 3.1415926 * 2.0;
|
|
144
|
+
//每5秒一个循环
|
|
145
|
+
iTime = iTime / 5.0;
|
|
146
|
+
//将像素坐标归一化到[0,1]范围
|
|
147
|
+
vec2 uv = gl_FragCoord.xy / czm_viewport.zw;
|
|
148
|
+
//矩形化使XY方向的每像素变化值一致
|
|
149
|
+
uv *= vec2(czm_viewport.z / czm_viewport.w, 1.0);
|
|
150
|
+
//范围调整为[-0.5, 0.5]
|
|
151
|
+
uv -= vec2(.5);
|
|
152
|
+
//基础底色
|
|
153
|
+
vec3 col = vec3(0.3);
|
|
154
|
+
float light = perlight( uv, 32., fract( iTime * 1.4 ) * 26. );
|
|
155
|
+
col+=light;
|
|
156
|
+
if(col.r+col.g+col.b < 2.0) out_FragColor =texture(colorTexture, v_textureCoordinates);
|
|
157
|
+
//混合比例
|
|
158
|
+
else out_FragColor = mix( texture(colorTexture, v_textureCoordinates) , vec4(col,1.0) , 0.8);
|
|
159
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EllipsoidSurfaceAppearance } from "cesium";
|
|
2
|
+
import gsap from "gsap";
|
|
3
|
+
/**在外观Appearance上直接修改着色器的极简demo
|
|
4
|
+
* 无法运行时最好先console.log查看标准外观类的源码,有时官方可能更改了部分定义,写此文件时变化varing => in , gl_FragColor => out_FragColor
|
|
5
|
+
*/
|
|
6
|
+
export class AppearanceDemo extends EllipsoidSurfaceAppearance {
|
|
7
|
+
constructor() {
|
|
8
|
+
super({
|
|
9
|
+
/**最好先console.log查看外观的着色器源码 */
|
|
10
|
+
fragmentShaderSource: `
|
|
11
|
+
in vec3 v_positionMC;
|
|
12
|
+
in vec3 v_positionEC;
|
|
13
|
+
in vec2 v_st;
|
|
14
|
+
uniform float uTime;
|
|
15
|
+
void main(){
|
|
16
|
+
float gradient = (v_positionMC.z + 100000.0) / 200000.0;
|
|
17
|
+
out_FragColor = vec4(v_st , uTime , 1.0);
|
|
18
|
+
}
|
|
19
|
+
`
|
|
20
|
+
});
|
|
21
|
+
gsap.to(this.uniforms, { uTime: 1, duration: 1, repeat: -1, yoyo: true })
|
|
22
|
+
}
|
|
23
|
+
/**在此处定义uniforms */
|
|
24
|
+
private uniforms = {
|
|
25
|
+
uTime: 0
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './demo';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Cartesian3, Color, ColorGeometryInstanceAttribute, DistanceDisplayCondition, DistanceDisplayConditionGeometryInstanceAttribute, EllipseGeometry, EllipsoidSurfaceAppearance, Geometry, GeometryInstance, Material, PolygonGeometry, Primitive, RectangleGeometry, createGuid } from "cesium";
|
|
2
|
+
import * as Cesium from "cesium";
|
|
3
|
+
import { uc_getDistanceByLatOffset } from "../utils";
|
|
4
|
+
import { AppearanceDemo } from "./appearance";
|
|
5
|
+
import { uc_geometryEllipse, uc_geometryPolygon } from "./geometry/geometry";
|
|
6
|
+
/**特定区域的图元(2D)
|
|
7
|
+
* polygon == 多边形
|
|
8
|
+
* circle == 圆形
|
|
9
|
+
*/
|
|
10
|
+
export class PrimitiveArea extends Primitive {
|
|
11
|
+
constructor(opt: OptPrimitiveAreaEllipse | OptPrimitiveAreaPolygon) {
|
|
12
|
+
const { id = createGuid(), type, positions, radius, color = Color.RED.withAlpha(0.5) } = opt;
|
|
13
|
+
const geometry = type === 'ellipse' ? uc_geometryEllipse(positions, radius) : uc_geometryPolygon(positions)
|
|
14
|
+
const instance = new GeometryInstance({
|
|
15
|
+
id,
|
|
16
|
+
geometry,
|
|
17
|
+
attributes: {
|
|
18
|
+
color: ColorGeometryInstanceAttribute.fromColor(Color.RED.withAlpha(0.5))
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
/**设定采用几何体与地球的椭球体平行的外观(优化渲染)*/
|
|
22
|
+
let appearance = new EllipsoidSurfaceAppearance({
|
|
23
|
+
/**采用点顶点颜色材质 */
|
|
24
|
+
material: Material.fromType('Color', { color })
|
|
25
|
+
})
|
|
26
|
+
super({
|
|
27
|
+
geometryInstances: [instance],
|
|
28
|
+
appearance: appearance,
|
|
29
|
+
});
|
|
30
|
+
this.id = id;
|
|
31
|
+
}
|
|
32
|
+
public id: string;
|
|
33
|
+
|
|
34
|
+
override getGeometryInstanceAttributes(id: any) {
|
|
35
|
+
return {
|
|
36
|
+
color: ColorGeometryInstanceAttribute.toValue(Color.RED.withAlpha(0.5)),
|
|
37
|
+
distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.toValue(new DistanceDisplayCondition(1000, 50000))
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ArcType, Cartesian3, EllipseGeometry, Ellipsoid, EllipsoidSurfaceAppearance, PolygonGeometry, PolygonHierarchy, VertexFormat } from "cesium";
|
|
2
|
+
import { uc_deepAssign, uc_getCartesian3 } from "../../utils";
|
|
3
|
+
import { RESULT_Cartesian3, RESULT_Cartesian3_A, RESULT_Cartesian3_B } from "../../core/viewer";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**生成多边形几何体 */
|
|
8
|
+
function generatePolygon(positions: LnglatHeight[], option?: PolygonGeometryOpt): PolygonGeometry {
|
|
9
|
+
const ph = positions.map(e => uc_getCartesian3(e))
|
|
10
|
+
const polygonHierarchy = new PolygonHierarchy(ph),
|
|
11
|
+
geometry = new PolygonGeometry({
|
|
12
|
+
polygonHierarchy,
|
|
13
|
+
/**距离表面高度 */
|
|
14
|
+
height: 0,
|
|
15
|
+
/**顶点格式(UV,法线如何设置) */
|
|
16
|
+
vertexFormat: EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
17
|
+
});
|
|
18
|
+
return geometry;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**生成椭圆几何体(包括圆)
|
|
22
|
+
* @param positions 几何体中心位置()
|
|
23
|
+
* @param radiusMajor 椭圆的大半径
|
|
24
|
+
* @param radiusMinor 椭圆的小半径(不设置时等于radiusMajor)
|
|
25
|
+
* @param options
|
|
26
|
+
*/
|
|
27
|
+
function generateEllipse(center: LnglatHeight, radiusMajor?: number | LnglatHeight, radiusMinor?: number, options: Partial<EllipseGeometryOpt> = {}): EllipseGeometry {
|
|
28
|
+
const C3 = uc_getCartesian3(center, RESULT_Cartesian3_A);
|
|
29
|
+
const radius = Array.isArray(radiusMajor) ? Cartesian3.distance(C3, uc_getCartesian3(radiusMajor, RESULT_Cartesian3_B)) : radiusMajor;
|
|
30
|
+
radiusMinor = radiusMinor || radius;
|
|
31
|
+
const opt: EllipseGeometryOpt = uc_deepAssign(options, {
|
|
32
|
+
center: C3,
|
|
33
|
+
semiMajorAxis: radius,
|
|
34
|
+
semiMinorAxis: radiusMinor,
|
|
35
|
+
}) as EllipseGeometryOpt
|
|
36
|
+
const geometry = new EllipseGeometry(opt);
|
|
37
|
+
return geometry;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
generatePolygon as uc_geometryPolygon,
|
|
42
|
+
generateEllipse as uc_geometryEllipse,
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Appearance, Cartesian3, Color, ColorGeometryInstanceAttribute, ComponentDatatype, DistanceDisplayCondition, DistanceDisplayConditionGeometryInstanceAttribute, EllipseGeometry, EllipsoidSurfaceAppearance, GeometryInstance, GeometryInstanceAttribute, Matrix3, Matrix4, Primitive, Quaternion } from "cesium";
|
|
2
|
+
import { MaterialImage2D } from "./material";
|
|
3
|
+
import { CMath, uc_arrChange, uc_getDiffDegreesByDistance, uc_getQuaternion, uc_getUUID } from "../utils";
|
|
4
|
+
import { uc_geometryEllipse } from "./geometry/geometry";
|
|
5
|
+
import EllipsoidSurfaceAppearanceFS from './shaders/EllipsoidSurfaceAppearanceFS.glsl'
|
|
6
|
+
import EllipsoidSurfaceAppearanceVS from './shaders/EllipsoidSurfaceAppearanceVS.glsl'
|
|
7
|
+
|
|
8
|
+
/**这是一个关于图片的Primitive */
|
|
9
|
+
export class PrimitiveImage2D extends Primitive {
|
|
10
|
+
/**要避免空白闪烁可预加载 */
|
|
11
|
+
static materials: { [K: string]: MaterialImage2D } = Object.create(null)
|
|
12
|
+
/**
|
|
13
|
+
* @param url 图片地址
|
|
14
|
+
* @param opt 数据参数
|
|
15
|
+
*/
|
|
16
|
+
constructor(url: string, opt: OptPrimitiveImage2D[]) {
|
|
17
|
+
const instances = opt.map(e => PrimitiveImage2D.createGeometryInstance(e))
|
|
18
|
+
const material = PrimitiveImage2D.materials[url] = PrimitiveImage2D.materials[url] || new MaterialImage2D(url)
|
|
19
|
+
/**远距离点位 */
|
|
20
|
+
/**生成几何体实例 */
|
|
21
|
+
/**设定采用几何体与地球的椭球体平行的外观(优化渲染)*/
|
|
22
|
+
let appearance = new EllipsoidSurfaceAppearance({
|
|
23
|
+
/**避免空白闪烁 (采用new会出现闪烁现象)*/
|
|
24
|
+
material: material,
|
|
25
|
+
/**vertexShaderSource 可以自己写顶点着色器main入口 */
|
|
26
|
+
vertexShaderSource: EllipsoidSurfaceAppearanceVS,
|
|
27
|
+
/**fragmentShaderSource 可以自己写顶点着色器main入口 */
|
|
28
|
+
fragmentShaderSource: EllipsoidSurfaceAppearanceFS,
|
|
29
|
+
})
|
|
30
|
+
super({
|
|
31
|
+
/**多个相同材质的实例采用实例组也能优化性能 */
|
|
32
|
+
geometryInstances: instances,
|
|
33
|
+
/**外观 */
|
|
34
|
+
appearance: appearance,
|
|
35
|
+
// 视锥体裁剪(默认开启,自动隐藏视野外的点)
|
|
36
|
+
cull: true,
|
|
37
|
+
// 优化参数:关闭拾取(无需点击时,进一步提升性能)
|
|
38
|
+
// pickPrimitive: false,
|
|
39
|
+
});
|
|
40
|
+
uc_arrChange(this.options, opt);
|
|
41
|
+
}
|
|
42
|
+
/**示例图源所有配置(配合相机变化geometry) */
|
|
43
|
+
private options: OptPrimitiveImage2D[] = [];
|
|
44
|
+
|
|
45
|
+
/**添加实体到此类 */
|
|
46
|
+
public addInstance(opt: OptPrimitiveImage2D[]) {
|
|
47
|
+
const { geometryInstances, options } = this;
|
|
48
|
+
uc_arrChange(options, opt);
|
|
49
|
+
const instances = opt.map(e => PrimitiveImage2D.createGeometryInstance(e))
|
|
50
|
+
if (Array.isArray(geometryInstances)) uc_arrChange(geometryInstances, instances);
|
|
51
|
+
}
|
|
52
|
+
/**创建几何实体 */
|
|
53
|
+
private static createGeometryInstance(opt: OptPrimitiveImage2D): GeometryInstance {
|
|
54
|
+
const { positions, size = 100, id = uc_getUUID(), rotation = 0 } = opt;
|
|
55
|
+
const geometry = uc_geometryEllipse(positions, size / 2, size / 2, { stRotation: CMath.toRadians(rotation), vertexFormat: EllipsoidSurfaceAppearance.VERTEX_FORMAT, })
|
|
56
|
+
const instance = new GeometryInstance({
|
|
57
|
+
/**场景pick拾取时获得的id */
|
|
58
|
+
id,
|
|
59
|
+
geometry,
|
|
60
|
+
attributes: {
|
|
61
|
+
/**尝试通过color属性将图片定位传入 */
|
|
62
|
+
color: ColorGeometryInstanceAttribute.fromColor(Color.fromBytes(0, 0, 0, 255)),
|
|
63
|
+
// distanceDisplayCondition: new DistanceDisplayConditionGeometryInstanceAttribute(100, 500000),
|
|
64
|
+
/**报错 */
|
|
65
|
+
// distanceDisplayCondition: new DistanceDisplayCondition(100, 500000),
|
|
66
|
+
// 定义一个自定义的“进度”属性
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
return instance;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './particle';
|
|
2
|
+
export * from './area';
|
|
3
|
+
export * from './image-2d';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**Primitive(基元):轻量级图形对象,表示几何体和材质的组合。是Cesium底层渲染单元,用于高效地绘制大规模的图形。使用Primitive,你可以直接控制几何体的位置、旋转、缩放等属性。Primitive通常用于绘制地形、模型、点云等图形,以及自定义的几何形状。
|
|
7
|
+
* Primitive用于表示简单的图形对象,侧重于几何体和渲染
|
|
8
|
+
* 创建方式更接近渲染引擎底层,需要初始化很多对象,比如外观(Appearance)、几何形状(Geometry)等,使用相对繁琐
|
|
9
|
+
*/
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Cartesian3, GeometryInstance, Matrix3, Matrix4, Quaternion, Transforms } from "cesium";
|
|
2
|
+
import { Transform } from "stream";
|
|
3
|
+
import { CMath } from "../../utils";
|
|
4
|
+
/**Instance(实例):是Cesium中用于高效绘制大量相似几何体的概念。Instance允许你使用共享的几何体定义,并通过单独的变换矩阵来实例化多个对象。通过使用Instance,可以显著减少内存占用和绘制调用的开销。Instance通常用于绘制大规模的点云、树木、草地等类型的图形。*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**将几何体实例化并返回该几何实例 */
|
|
8
|
+
function instanceGeometry(options: OptInstanceGeometry) {
|
|
9
|
+
const { id = '', geometry = '', modelMatrix, attributes, lnglat, size, rotation } = options;
|
|
10
|
+
const rotationAngle = -CMath.toRadians(rotation); // 顺时针30°(负弧度)
|
|
11
|
+
const targetPos = Cartesian3.fromDegrees(lnglat[0], lnglat[1]), originalPos = Cartesian3.fromDegrees(117.78286848, 38.94981791);
|
|
12
|
+
// 2. 计算平移偏移量(目标位置 - 初始位置)
|
|
13
|
+
const offset = Cartesian3.subtract(
|
|
14
|
+
targetPos,
|
|
15
|
+
originalPos,
|
|
16
|
+
new Cartesian3() // 复用对象优化性能
|
|
17
|
+
);
|
|
18
|
+
// 3. 构建缩放矩阵(XYZ等比缩放)[此缩放矩阵是个错误的缩放]
|
|
19
|
+
const scaleRatio = size / 5000;
|
|
20
|
+
const scaleMatrix = Matrix4.fromScale(
|
|
21
|
+
new Cartesian3(scaleRatio, scaleRatio, 1)
|
|
22
|
+
);
|
|
23
|
+
// 4. 构建旋转矩阵(绕Z轴顺时针旋转30°,正北朝向旋转)
|
|
24
|
+
const rotationQuaternion = Quaternion.fromAxisAngle(
|
|
25
|
+
Cartesian3.UNIT_Z, // 旋转轴:Z轴(水平旋转)
|
|
26
|
+
rotationAngle
|
|
27
|
+
);
|
|
28
|
+
const rotationMatrix3 = Matrix3.fromQuaternion(rotationQuaternion);
|
|
29
|
+
const rotationMatrix4 = Matrix4.fromRotation(rotationMatrix3);
|
|
30
|
+
// 5. 构建平移矩阵(基于偏移量)
|
|
31
|
+
const translationMatrix = Matrix4.fromTranslation(offset);
|
|
32
|
+
|
|
33
|
+
// 6. 组合最终变换矩阵(核心:先缩放→再旋转→最后平移)
|
|
34
|
+
// 步骤1:组合缩放+旋转矩阵
|
|
35
|
+
const scaleRotateMatrix = Matrix4.multiply(
|
|
36
|
+
rotationMatrix4,
|
|
37
|
+
scaleMatrix,
|
|
38
|
+
new Matrix4()
|
|
39
|
+
);
|
|
40
|
+
// 步骤2:叠加平移矩阵
|
|
41
|
+
const finalMatrix =Matrix4.multiply(
|
|
42
|
+
translationMatrix,
|
|
43
|
+
scaleRotateMatrix,
|
|
44
|
+
new Matrix4()
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return new GeometryInstance({
|
|
48
|
+
id,
|
|
49
|
+
geometry: geometry,
|
|
50
|
+
modelMatrix: scaleMatrix,
|
|
51
|
+
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
instanceGeometry as uc_instanceGeometry
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Material } from "cesium";
|
|
2
|
+
import FSImage from '../shaders/imageFS.glsl';
|
|
3
|
+
import gsap from "gsap";
|
|
4
|
+
/**fabric方式自定义着色器添加2D的图片采用 */
|
|
5
|
+
export class MaterialImage2D extends Material {
|
|
6
|
+
constructor(url) {
|
|
7
|
+
super({
|
|
8
|
+
fabric: {
|
|
9
|
+
/**采用着色器不能使用type */
|
|
10
|
+
// type: "Image",
|
|
11
|
+
uniforms: {
|
|
12
|
+
image: url,
|
|
13
|
+
uTime: 0,
|
|
14
|
+
|
|
15
|
+
},
|
|
16
|
+
/**为了避免#define GLSLIFY 1导致的开发异常 */
|
|
17
|
+
source: `
|
|
18
|
+
${FSImage}
|
|
19
|
+
`
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
gsap.to(this.uniforms, { uTime: 1, duration: 2, repeat: -1, ease: 'linear' })
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 基础材质类型查阅 API : Material
|
|
3
|
+
* 示例: Image类型 :Material.fromType('Image', {image: url,repeat: new Cartesian2(1.0, 1.0),})
|
|
4
|
+
* 本文件夹主要采用fabric自定义着色器模式实现对基础材质的封装
|
|
5
|
+
* https://cesium.com/downloads/cesiumjs/releases/b28/Documentation/czm_material.html?classFilter=&show=glsl
|
|
6
|
+
*/
|
|
7
|
+
export * from './image2d';
|
|
8
|
+
export * from './ship2d';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Material } from "cesium";
|
|
2
|
+
import { FrameBacks } from "../../core";
|
|
3
|
+
/**fabric方式自定义着色器添加2D的图片采用 */
|
|
4
|
+
export class MaterialShip2D extends Material {
|
|
5
|
+
constructor(url) {
|
|
6
|
+
super({
|
|
7
|
+
fabric: {
|
|
8
|
+
/**采用着色器不能使用type */
|
|
9
|
+
// type: "Image",
|
|
10
|
+
uniforms: {
|
|
11
|
+
image1: "/Assets/images/icon_small_type_EA.png",
|
|
12
|
+
image2: "/Assets/images/icon_small_type_EB.png",
|
|
13
|
+
image3: "/Assets/images/icon_small_type_EC.png",
|
|
14
|
+
image4: "/Assets/images/icon_small_type_ED.png",
|
|
15
|
+
image5: "/Assets/images/icon_small_type_EE.png",
|
|
16
|
+
image6: "/Assets/images/icon_small_type_EF.png",
|
|
17
|
+
image7: "/Assets/images/icon_small_type_EG.png",
|
|
18
|
+
image8: "/Assets/images/icon_small_type_EH.png",
|
|
19
|
+
uTime: 0
|
|
20
|
+
},
|
|
21
|
+
source: `
|
|
22
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
23
|
+
{
|
|
24
|
+
// 生成默认的基础材质
|
|
25
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
26
|
+
//获取uv
|
|
27
|
+
vec2 st = materialInput.st;vec4 colorImage = vec4(1.0,1.0,1.0,1.0);
|
|
28
|
+
float shipType = 2.0;
|
|
29
|
+
//czm_batchTable_shipType;
|
|
30
|
+
if (shipType == 1.0) { // cargo
|
|
31
|
+
colorImage = texture(image1, vec2( st.s, st.t));
|
|
32
|
+
} else if (shipType == 2.0) { // tanker
|
|
33
|
+
colorImage = texture(image2, vec2( st.s, st.t));
|
|
34
|
+
} else if (shipType == 3.0) { // passenger
|
|
35
|
+
colorImage = texture(image3, vec2( st.s, st.t));
|
|
36
|
+
} else if (shipType == 4.0) { // fishing
|
|
37
|
+
colorImage = texture(image4, vec2( st.s, st.t));
|
|
38
|
+
}
|
|
39
|
+
material.alpha = colorImage.a;
|
|
40
|
+
material.diffuse = colorImage.rgb;
|
|
41
|
+
return material;
|
|
42
|
+
}
|
|
43
|
+
`
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
FrameBacks.push({
|
|
47
|
+
target: this.uniforms,
|
|
48
|
+
uTime: 1,
|
|
49
|
+
duration: 2,
|
|
50
|
+
repeat: -1,
|
|
51
|
+
ease: 'none'
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Cartesian2, Cartesian3, CircleEmitter, Color, Entity, JulianDate, Matrix4, ParticleSystem, Primitive } from "cesium";
|
|
2
|
+
/**粒子 */
|
|
3
|
+
export class PrimityParticle extends ParticleSystem {
|
|
4
|
+
constructor() {
|
|
5
|
+
const box = new Entity({
|
|
6
|
+
name: 'box',
|
|
7
|
+
position: Cartesian3.fromDegrees(113.3191, 23.109, 250),
|
|
8
|
+
box: {
|
|
9
|
+
dimensions: new Cartesian3(100, 100, 500),
|
|
10
|
+
material: Color.RED.withAlpha(0.5),
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
super({
|
|
14
|
+
//粒子图片
|
|
15
|
+
image: '/Assets/particle/smoke.png',
|
|
16
|
+
//粒子图像大小
|
|
17
|
+
imageSize: new Cartesian2(20, 20),
|
|
18
|
+
//开始时粒子大小
|
|
19
|
+
startScale: 1.0,
|
|
20
|
+
//结束时粒子大小
|
|
21
|
+
endScale: 5.0,
|
|
22
|
+
//粒子速度
|
|
23
|
+
speed: 5.0,
|
|
24
|
+
/** */
|
|
25
|
+
|
|
26
|
+
//粒子速度变化范围
|
|
27
|
+
// minimumSpeed: 5.0,
|
|
28
|
+
// maximumSpeed: 6.0,
|
|
29
|
+
//发射器
|
|
30
|
+
emitter: new CircleEmitter(20.0),
|
|
31
|
+
//粒子发射速率 每秒发射粒子数
|
|
32
|
+
emissionRate: 30.0,
|
|
33
|
+
//粒子生命周期
|
|
34
|
+
lifetime: 10.0,
|
|
35
|
+
//粒子生命周期变化范围
|
|
36
|
+
// minimumParticleLife: 5.0,
|
|
37
|
+
// maximumParticleLife: 10.0,
|
|
38
|
+
// emitterModelMatrix: box.computeModelMatrix(viewer.clock.currentTime, new Matrix4()),
|
|
39
|
+
//发射器位置
|
|
40
|
+
modelMatrix: box.computeModelMatrix(new JulianDate(), new Matrix4()),
|
|
41
|
+
//粒子颜色
|
|
42
|
+
startColor: Color.BLUE.withAlpha(1.0),
|
|
43
|
+
//结束颜色
|
|
44
|
+
endColor: Color.BLUE.withAlpha(0.9),
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
in vec3 v_positionMC;
|
|
2
|
+
in vec3 v_positionEC;
|
|
3
|
+
in vec2 v_st;
|
|
4
|
+
in vec4 v_color;
|
|
5
|
+
void main()
|
|
6
|
+
{
|
|
7
|
+
czm_materialInput materialInput;
|
|
8
|
+
|
|
9
|
+
vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
|
|
10
|
+
#ifdef FACE_FORWARD
|
|
11
|
+
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
materialInput.s = v_st.s;
|
|
15
|
+
materialInput.st = v_st;
|
|
16
|
+
materialInput.str = vec3(v_st, 0.0);
|
|
17
|
+
|
|
18
|
+
// Convert tangent space material normal to eye space
|
|
19
|
+
materialInput.normalEC = normalEC;
|
|
20
|
+
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
|
|
21
|
+
|
|
22
|
+
// Convert view vector to world space
|
|
23
|
+
vec3 positionToEyeEC = -v_positionEC;
|
|
24
|
+
materialInput.positionToEyeEC = positionToEyeEC;
|
|
25
|
+
czm_material material = czm_getMaterial(materialInput);
|
|
26
|
+
#ifdef FLAT
|
|
27
|
+
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
28
|
+
#else
|
|
29
|
+
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
30
|
+
#endif
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
in vec3 position3DHigh;
|
|
2
|
+
in vec3 position3DLow;
|
|
3
|
+
in vec2 st;
|
|
4
|
+
in float batchId;
|
|
5
|
+
in vec4 color;
|
|
6
|
+
out vec3 v_positionMC;
|
|
7
|
+
out vec3 v_positionEC;
|
|
8
|
+
out vec2 v_st;
|
|
9
|
+
out vec4 v_color;
|
|
10
|
+
void main()
|
|
11
|
+
{
|
|
12
|
+
vec4 p = czm_computePosition();
|
|
13
|
+
|
|
14
|
+
v_positionMC = position3DHigh + position3DLow; // position in model coordinates
|
|
15
|
+
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
|
16
|
+
v_st = st;
|
|
17
|
+
v_color = color;
|
|
18
|
+
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//非常简单的图片显示
|
|
2
|
+
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
3
|
+
{
|
|
4
|
+
// 生成默认的基础材质
|
|
5
|
+
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
6
|
+
//获取uv
|
|
7
|
+
vec2 st = materialInput.st;
|
|
8
|
+
//获取相机到此实例的距离
|
|
9
|
+
float distance = length(materialInput.positionToEyeEC);
|
|
10
|
+
//距离越远,此实例就全覆盖[500000]
|
|
11
|
+
// if (distance > 500000.0) {
|
|
12
|
+
// //如果距离大于50000,则不显示
|
|
13
|
+
// material.alpha = 0.0;
|
|
14
|
+
// return material;
|
|
15
|
+
// }
|
|
16
|
+
//如果距离小于50000,则缩放再显示
|
|
17
|
+
//根据uv获取颜色
|
|
18
|
+
vec4 colorImage = texture(image, vec2( st.s, st.t));
|
|
19
|
+
material.alpha = colorImage.a;
|
|
20
|
+
material.diffuse = colorImage.rgb;
|
|
21
|
+
return material;
|
|
22
|
+
}
|