|
@@ -378,16 +378,16 @@ export function uwbMain(domId, modelWidth, modelHeight, finalMode, callback) {
|
|
//初始化uwb插件
|
|
//初始化uwb插件
|
|
let uwbInstance = uwbInit(originPointPose);
|
|
let uwbInstance = uwbInit(originPointPose);
|
|
|
|
|
|
- if (false)
|
|
|
|
- if (g_gltf_downloaded == false) {
|
|
|
|
- let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
|
|
|
|
- sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
|
|
|
|
- let pointLight = new THREE.PointLight(0xffffff, 1, 0);
|
|
|
|
- pointLight.position.set(200, 200, 200); //设置点光源位置
|
|
|
|
- sdkInstance.sceneRenderer.scene.add(pointLight); //将点光源添加至场景
|
|
|
|
- g_gltf_downloaded = true;
|
|
|
|
- getsqlData(sdkInstance, uwbInstance);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ if (g_gltf_downloaded == false) {
|
|
|
|
+ let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
|
|
|
|
+ sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
|
|
|
|
+ let pointLight = new THREE.PointLight(0xffffff, 1, 0);
|
|
|
|
+ pointLight.position.set(200, 200, 200); //设置点光源位置
|
|
|
|
+ sdkInstance.sceneRenderer.scene.add(pointLight); //将点光源添加至场景
|
|
|
|
+ g_gltf_downloaded = true;
|
|
|
|
+ getsqlData(sdkInstance, uwbInstance);
|
|
|
|
+ }
|
|
let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
|
|
let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
|
|
sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
|
|
sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
|
|
let pointLight = new THREE.PointLight(0xffffff, 1, 0);
|
|
let pointLight = new THREE.PointLight(0xffffff, 1, 0);
|
|
@@ -399,41 +399,41 @@ export function uwbMain(domId, modelWidth, modelHeight, finalMode, callback) {
|
|
},
|
|
},
|
|
100
|
|
100
|
|
);
|
|
);
|
|
- if (false)
|
|
|
|
- if (g_fbxLoader == null) {
|
|
|
|
- g_fbxLoader = new THREE.GLTFLoader();
|
|
|
|
- g_fbxLoader.load("../models/mesh2.gltf", function (fbx) {
|
|
|
|
- let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
|
|
|
|
- sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
|
|
|
|
- let pointLight = new THREE.PointLight(0xffffff, 1, 0);
|
|
|
|
- pointLight.position.set(200, 200, 200); //设置点光源位置
|
|
|
|
- sdkInstance.sceneRenderer.scene.add(pointLight); //将点光源添加至场景
|
|
|
|
- g_fbx = fbx;
|
|
|
|
- console.log("控制台查看加载gltf文件返回的对象结构", fbx);
|
|
|
|
- //fbx.scene.children[0].children[0].scale.set(5, 5, 5)
|
|
|
|
- //window.shader = new THREE.MeshStandardMaterial(fbx.scene.children[0].children[0].material);
|
|
|
|
- //window.shader1 = new THREE.MeshStandardMaterial(fbx.scene.children[0].children[0].material);
|
|
|
|
- setTimeout(
|
|
|
|
- function () {
|
|
|
|
|
|
+
|
|
|
|
+ if (g_fbxLoader == null) {
|
|
|
|
+ g_fbxLoader = new THREE.GLTFLoader();
|
|
|
|
+ g_fbxLoader.load("../models/mesh2.gltf", function (fbx) {
|
|
|
|
+ let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
|
|
|
|
+ sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
|
|
|
|
+ let pointLight = new THREE.PointLight(0xffffff, 1, 0);
|
|
|
|
+ pointLight.position.set(200, 200, 200); //设置点光源位置
|
|
|
|
+ sdkInstance.sceneRenderer.scene.add(pointLight); //将点光源添加至场景
|
|
|
|
+ g_fbx = fbx;
|
|
|
|
+ console.log("控制台查看加载gltf文件返回的对象结构", fbx);
|
|
|
|
+ //fbx.scene.children[0].children[0].scale.set(5, 5, 5)
|
|
|
|
+ //window.shader = new THREE.MeshStandardMaterial(fbx.scene.children[0].children[0].material);
|
|
|
|
+ //window.shader1 = new THREE.MeshStandardMaterial(fbx.scene.children[0].children[0].material);
|
|
|
|
+ setTimeout(
|
|
|
|
+ function () {
|
|
|
|
+ getsqlData(sdkInstance, uwbInstance)
|
|
|
|
+ },
|
|
|
|
+ 100
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ if (false) {
|
|
|
|
+ sqlQueryInited = true;
|
|
|
|
+ var index = 0;
|
|
|
|
+ setTimeout(
|
|
|
|
+ function (card_id, x, y, z) {
|
|
|
|
+ var timerId = setInterval(function () {
|
|
|
|
+ //console.log(++index + "秒钟到了");
|
|
getsqlData(sdkInstance, uwbInstance)
|
|
getsqlData(sdkInstance, uwbInstance)
|
|
- },
|
|
|
|
- 100
|
|
|
|
- );
|
|
|
|
- });
|
|
|
|
- if (false) {
|
|
|
|
- sqlQueryInited = true;
|
|
|
|
- var index = 0;
|
|
|
|
- setTimeout(
|
|
|
|
- function (card_id, x, y, z) {
|
|
|
|
- var timerId = setInterval(function () {
|
|
|
|
- //console.log(++index + "秒钟到了");
|
|
|
|
- getsqlData(sdkInstance, uwbInstance)
|
|
|
|
- }, 1000);
|
|
|
|
- },
|
|
|
|
- 500
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
|
|
+ }, 1000);
|
|
|
|
+ },
|
|
|
|
+ 500
|
|
|
|
+ );
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
// 创建物体add
|
|
// 创建物体add
|