3D Tiles Gaussian Splatting Comparison
Runnable Cesium example: 3D Tiles Gaussian Splatting Comparison. Open the live demo, read the complete source, and copy the file into your project. No build step or API key.
single HTML file · CDN dependencies onlyinterface may contain Chinese labels
Source
<!--
示例:泼溅与点云的参数对比
说明:左右两组点云分别使用大点低透明与小点高不透明的参数,并加文字标注
核心逻辑:封装 cloud(lon, size, alpha, color) → 两组不同参数 → label 标注
依赖:CesiumJS 1.121 · jsDelivr CDN
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta name="robots" content="noindex,follow">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>泼溅与点云的参数对比</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cesium@1.121.0/Build/Cesium/Widgets/widgets.css">
<style>
html,body{height:100%;margin:0}
body{background:#0e1116;color:#e6e8ec;overflow:hidden;
font:13px/1.6 -apple-system,"Segoe UI","PingFang SC",sans-serif}
#c{height:100%}
.tip{position:absolute;left:12px;top:12px;z-index:5;
background:rgba(23,28,35,.9);border:1px solid #2a313b;border-radius:6px;
padding:8px 12px;font-size:12px;color:#a2a9b6;max-width:320px;line-height:1.6}
.cesium-viewer-bottom .cesium-widget-credits,.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer{display:none!important}
</style>
</head>
<body>
<div id="c"></div>
<div class="tip">左边点大而透明,像雾;右边点小而实,像砂砾。两组点数相同,只差两个参数。</div>
<script src="https://cdn.jsdelivr.net/npm/cesium@1.121.0/Build/Cesium/Cesium.js"></script>
<script>
(function () {
'use strict';
var viewer = new Cesium.Viewer('c', {
baseLayer: false,
baseLayerPicker: false, geocoder: false, homeButton: false,
sceneModePicker: false, navigationHelpButton: false,
animation: false, timeline: false, fullscreenButton: false,
infoBox: false, selectionIndicator: false
});
var scene = viewer.scene;
scene.globe.baseColor = Cesium.Color.fromCssColorString('#1c2733');
scene.backgroundColor = Cesium.Color.fromCssColorString('#0e1116');
scene.skyBox.show = false;
scene.sun.show = false;
scene.moon.show = false;
if (scene.skyAtmosphere) scene.skyAtmosphere.show = false;
function cloud(lon, size, alpha, color) {
var seed = 41 + lon * 1000 | 0;
function rnd() { seed = (seed * 9301 + 49297) % 233280; return seed / 233280; }
var pc = scene.primitives.add(new Cesium.PointPrimitiveCollection());
for (var i = 0; i < 3500; i++) {
var r = Math.pow(rnd(), 0.6) * 0.0012;
var a = rnd() * Math.PI * 2;
pc.add({
position: Cesium.Cartesian3.fromDegrees(
lon + Math.cos(a) * r, 39.907 + Math.sin(a) * r, Math.pow(rnd(), 1.5) * 26),
pixelSize: size,
color: Cesium.Color.fromCssColorString(color).withAlpha(alpha)
});
}
return pc;
}
cloud(116.3894, 20, 0.16, '#4d9bff'); /* 左侧:大点低透明度 */
cloud(116.3926, 3, 0.85, '#ffb44d'); /* 右侧:小点高不透明度 */
function label(lon, text) {
viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(lon, 39.9102, 0),
label: {
text: text,
font: '600 14px sans-serif',
fillColor: Cesium.Color.WHITE,
showBackground: true,
backgroundColor: Cesium.Color.fromCssColorString('#1b232e').withAlpha(0.85),
pixelOffset: new Cesium.Cartesian2(0, -8)
}
});
}
label(116.3894, '大点 · 低透明');
label(116.3926, '小点 · 高不透明');
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(116.391, 39.8998, 300),
orientation: { heading: 0, pitch: Cesium.Math.toRadians(-14), roll: 0 },
duration: 0
});
})();
</script>
</body>
</html>
Language: the code and this page are in English; the full tutorial and API notes for this example are in Chinese. The demo itself is the authoritative version — it runs exactly as shown.