|
|
@@ -169,16 +169,18 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
|
|
|
const controls = new OrbitControls(camera, renderer.domElement)
|
|
|
|
|
|
- controls.enablePan = false // 禁用右键平移功能
|
|
|
+ controls.enablePan = true // 禁用右键平移功能
|
|
|
|
|
|
controls.enableZoom = true // 必须禁用轨道控制器的默认缩放[1](@ref)
|
|
|
|
|
|
controls.enableDamping = true
|
|
|
controls.dampingFactor = 0.25
|
|
|
controls.screenSpacePanning = false
|
|
|
- controls.maxPolarAngle = Math.PI / 2
|
|
|
+ controls.minPolarAngle = Math.PI / 180 * 1 // 1 度(约 0.01745 弧度)
|
|
|
+ controls.maxPolarAngle = Math.PI - Math.PI / 180 * 1 // 179 度(约 3.124 弧度)
|
|
|
|
|
|
// 兼容鼠标滚轮与触摸屏双指缩放
|
|
|
+ // 兼容鼠标滚轮与触摸屏双指缩放
|
|
|
// const handleZoom = (delta) => {
|
|
|
// // console.log('--------',delta);
|
|
|
|