|
@@ -9,6 +9,7 @@ const urlAll = window.location.href.split("?m=")[1];
|
|
|
// console.log(123456,urlAll);
|
|
// console.log(123456,urlAll);
|
|
|
|
|
|
|
|
const USDZ_FILEPATH = `https://4dkankan.oss-cn-shenzhen.aliyuncs.com/sxz/${urlAll}.usdz`;
|
|
const USDZ_FILEPATH = `https://4dkankan.oss-cn-shenzhen.aliyuncs.com/sxz/${urlAll}.usdz`;
|
|
|
|
|
+// const USDZ_FILEPATH = `https://us-test.4dkankan.com/20241202dome/Shuiyueguanyin.usdz`;
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", async () => {
|
|
document.addEventListener("DOMContentLoaded", async () => {
|
|
|
const loadingBar = document.getElementById("loading"); // 获取加载条元素
|
|
const loadingBar = document.getElementById("loading"); // 获取加载条元素
|
|
@@ -62,6 +63,8 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
initTinyUSDZ().then(function (TinyUSDZLoader) {
|
|
initTinyUSDZ().then(function (TinyUSDZLoader) {
|
|
|
const usd = new TinyUSDZLoader.TinyUSDZLoader(usd_data);
|
|
const usd = new TinyUSDZLoader.TinyUSDZLoader(usd_data);
|
|
|
// console.log(usd.numMeshes());
|
|
// console.log(usd.numMeshes());
|
|
|
|
|
+ // 隐藏加载条
|
|
|
|
|
+ loadingBar.style.display = "none";
|
|
|
|
|
|
|
|
const scene = new THREE.Scene();
|
|
const scene = new THREE.Scene();
|
|
|
const camera = new THREE.PerspectiveCamera(
|
|
const camera = new THREE.PerspectiveCamera(
|
|
@@ -80,6 +83,8 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
|
|
|
|
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
|
renderer.setAnimationLoop(animate);
|
|
renderer.setAnimationLoop(animate);
|
|
|
|
|
+ // 设置输出颜色空间为线性SRGB
|
|
|
|
|
+ renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
|
|
|
document.body.appendChild(renderer.domElement);
|
|
document.body.appendChild(renderer.domElement);
|
|
|
|
|
|
|
|
// First mesh only
|
|
// First mesh only
|
|
@@ -161,9 +166,6 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
|
|
|
|
|
scene.add(cube);
|
|
scene.add(cube);
|
|
|
|
|
|
|
|
- //camera.position.z = 25;
|
|
|
|
|
- // camera.position.z = 1.0;
|
|
|
|
|
-
|
|
|
|
|
const controls = new OrbitControls(camera, renderer.domElement);
|
|
const controls = new OrbitControls(camera, renderer.domElement);
|
|
|
|
|
|
|
|
controls.enablePan = false; // 禁用右键平移功能
|
|
controls.enablePan = false; // 禁用右键平移功能
|