-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path物体编辑轴.html
83 lines (74 loc) · 2.71 KB
/
物体编辑轴.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>物体编辑轴</title>
<link rel="stylesheet" href="./Cesium/Widgets/widgets.css">
<style>
html,
body {
margin: 0;
padding: 0;
}
#buttons {
background-color: aquamarine;
position: absolute;
top: 1em;
left: 2em;
}
</style>
</head>
<body>
<script src="./Cesium/Cesium.js"></script>
<script src="./js/control.js"></script>
<script src="./js/objectControl.js"></script>
<div id="cesiumContainer">
</div>
<div id="buttons">
左击坐标轴后平移旋转,右键确认
<br>
<button onclick="start()">编辑</button>
<button onclick="end()">完成</button>
</div>
<script>
window.onload = function () {
document.querySelector("#cesiumContainer").style.height = window.innerHeight + 'px';
}
window.onresize = function () {
document.querySelector("#cesiumContainer").style.height = window.innerHeight + 'px';
}
var viewer = new Cesium.Viewer("cesiumContainer", {
animation: false, // 控制场景动画的播放速度控件
baseLayerPicker: true, // 底图切换控件
fullscreenButton: false, // 全屏控件
geocoder: false, // 地理位置查询定位控件
homeButton: false, // 默认相机位置控件
timeline: false, // 时间滚动条控件
infoBox: false, //是否显示信息框
sceneModePicker: false, //是否显示3D/2D选择器
selectionIndicator: false, // 点击点绿色弹出 是否显示选取指示器组件
navigationHelpButton: false, // 默认的相机控制提示控件
scene3DOnly: true, // 每个几何实例仅以3D渲染以节省GPU内存
navigationInstructionsInitiallyVisible: false,
showRenderLoopErrors: false, //是否显示渲染错误
orderIndependentTranslucency: false,//设置背景透明
});
viewer.scene.globe.depthTestAgainstTerrain = true;
viewer._cesiumWidget._creditContainer.style.display = "none";
viewer.scene.debugShowFramesPerSecond = true;
var tileset = viewer.scene.primitives.add(
new Cesium.Cesium3DTileset({
url: "./data/tileset/tileset.json"
})
);
viewer.flyTo(this.tileset);
var control;
function start() {
control = new objectControl(viewer, tileset, tileset.root.boundingSphere.center);
}
function end(){
control.destroy();
}
</script>
</body>
</html>