提交 8bde0dfa 编写于 作者: wanhai_wu's avatar wanhai_wu

add

上级 fa28e352
......@@ -95,6 +95,21 @@
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
const model_parameter = JSON.parse(localStorage.getItem('model_parameter' || ''));
let model_info = ''
let dRotation = [0,0,0]
let dPosition = [0,0,0]
if (model_parameter) {
model_info = model_parameter.parameter.modelInfo
dRotation = model_info.rotation
dPosition = model_info.dPosition
}
// debugger
const arrList = [
{
index: 0,
......@@ -205,6 +220,7 @@
);
camera.position.set(0, 0, 20);
// camera.rotation.set(,3,5)
camera.lookAt(0, 0, 0);
scene = new THREE.Scene();
......@@ -221,8 +237,12 @@
// const loader = new ColladaLoader( loadingManager );
const loader = new GLTFLoader()
loader.load("https://static.preclight.com/rebuild/MRDd60QaKy4Sf8iU_MRDd60QaKy4Sf8iU_miniprog_20230608.glb", function (gltf) {
loader.load(model_parameter.model_url, function (gltf) {
elf = gltf.scene;
elf.rotation.x = dRotation[0]
elf.rotation.y = dRotation[1]
elf.rotation.z = dRotation[2]
centerObject(elf, "************************");
scene.add(elf);
});
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册