31 changed files with 339 additions and 66069 deletions
-
BINpublic/webThird/asset/F51.glb
-
BINpublic/webThird/asset/F52.glb
-
BINpublic/webThird/asset/Line.glb
-
BINpublic/webThird/asset/TotalCamera.glb
-
BINpublic/webThird/asset/total2.glb
-
96public/webThird/index.js
-
2061public/webThird/js/bootstrap-slider.js
-
190public/webThird/js/easyloader.js
-
778public/webThird/js/index.js
-
18706public/webThird/js/jquery-ui.js
-
11008public/webThird/js/jquery.js
-
138public/webThird/js/jquery.timers.min.js
-
BINpublic/webWater/asset/Line.glb
-
BINpublic/webWater/asset/TotalCamera.glb
-
BINpublic/webWater/asset/total2.glb
-
302public/webWater/index.js
-
2061public/webWater/js/bootstrap-slider.js
-
190public/webWater/js/easyloader.js
-
778public/webWater/js/index.js
-
18706public/webWater/js/jquery-ui.js
-
11008public/webWater/js/jquery.js
-
138public/webWater/js/jquery.timers.min.js
-
9src/assets/styles/index.scss
-
11src/icons/svg/rotate.svg
-
13src/icons/svg/srotate.svg
-
19src/views/header/index.vue
-
15src/views/index.vue
-
64src/views/pageBasement/index.vue
-
69src/views/pageFullView/index.vue
-
21src/views/pageThirdFloor/index.vue
-
27src/views/pageWaterPumpHouse/index.vue
2061
public/webThird/js/bootstrap-slider.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,190 +0,0 @@ |
|||
/** |
|||
* EasyUI for jQuery 1.7.0 |
|||
* |
|||
* Copyright (c) 2009-2018 www.jeasyui.com. All rights reserved. |
|||
* |
|||
* Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
|
|||
* To use it on other terms please contact us: info@jeasyui.com |
|||
* |
|||
*/ |
|||
(function(){ |
|||
var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},datalist:{js:"jquery.datalist.js",css:"datalist.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","dialog","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},switchbutton:{js:"jquery.switchbutton.js",css:"switchbutton.css"},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},passwordbox:{js:"jquery.passwordbox.js",css:"passwordbox.css",dependencies:["textbox"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},radiobutton:{js:"jquery.radiobutton.js",css:"radiobutton.css"},checkbox:{js:"jquery.checkbox.js",css:"checkbox.css"},sidemenu:{js:"jquery.sidemenu.js",css:"sidemenu.css",dependencies:["accordion","tree","tooltip"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},combotreegrid:{js:"jquery.combotreegrid.js",dependencies:["combo","treegrid"]},tagbox:{js:"jquery.tagbox.js",dependencies:["combobox"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},parser:{js:"jquery.parser.js"},mobile:{js:"jquery.mobile.js"}}; |
|||
var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"}; |
|||
var _3={}; |
|||
function _4(_5,_6){ |
|||
var _7=false; |
|||
var _8=document.createElement("script"); |
|||
_8.type="text/javascript"; |
|||
_8.language="javascript"; |
|||
_8.src=_5; |
|||
_8.onload=_8.onreadystatechange=function(){ |
|||
if(!_7&&(!_8.readyState||_8.readyState=="loaded"||_8.readyState=="complete")){ |
|||
_7=true; |
|||
_8.onload=_8.onreadystatechange=null; |
|||
if(_6){ |
|||
_6.call(_8); |
|||
} |
|||
} |
|||
}; |
|||
document.getElementsByTagName("head")[0].appendChild(_8); |
|||
}; |
|||
function _9(_a,_b){ |
|||
_4(_a,function(){ |
|||
document.getElementsByTagName("head")[0].removeChild(this); |
|||
if(_b){ |
|||
_b(); |
|||
} |
|||
}); |
|||
}; |
|||
function _c(_d,_e){ |
|||
var _f=document.createElement("link"); |
|||
_f.rel="stylesheet"; |
|||
_f.type="text/css"; |
|||
_f.media="screen"; |
|||
_f.href=_d; |
|||
document.getElementsByTagName("head")[0].appendChild(_f); |
|||
if(_e){ |
|||
_e.call(_f); |
|||
} |
|||
}; |
|||
function _10(_11,_12){ |
|||
_3[_11]="loading"; |
|||
var _13=_1[_11]; |
|||
var _14="loading"; |
|||
var _15=(easyloader.css&&_13["css"])?"loading":"loaded"; |
|||
if(easyloader.css&&_13["css"]){ |
|||
if(/^http/i.test(_13["css"])){ |
|||
var url=_13["css"]; |
|||
}else{ |
|||
var url=easyloader.base+"themes/"+easyloader.theme+"/"+_13["css"]; |
|||
} |
|||
_c(url,function(){ |
|||
_15="loaded"; |
|||
if(_14=="loaded"&&_15=="loaded"){ |
|||
_16(); |
|||
} |
|||
}); |
|||
} |
|||
if(/^http/i.test(_13["js"])){ |
|||
var url=_13["js"]; |
|||
}else{ |
|||
var url=easyloader.base+"plugins/"+_13["js"]; |
|||
} |
|||
_4(url,function(){ |
|||
_14="loaded"; |
|||
if(_14=="loaded"&&_15=="loaded"){ |
|||
_16(); |
|||
} |
|||
}); |
|||
function _16(){ |
|||
_3[_11]="loaded"; |
|||
easyloader.onProgress(_11); |
|||
if(_12){ |
|||
_12(); |
|||
} |
|||
}; |
|||
}; |
|||
function _17(_18,_19){ |
|||
var mm=[]; |
|||
var _1a=false; |
|||
if(typeof _18=="string"){ |
|||
add(_18); |
|||
}else{ |
|||
for(var i=0;i<_18.length;i++){ |
|||
add(_18[i]); |
|||
} |
|||
} |
|||
function add(_1b){ |
|||
if(!_1[_1b]){ |
|||
return; |
|||
} |
|||
var d=_1[_1b]["dependencies"]; |
|||
if(d){ |
|||
for(var i=0;i<d.length;i++){ |
|||
add(d[i]); |
|||
} |
|||
} |
|||
mm.push(_1b); |
|||
}; |
|||
function _1c(){ |
|||
if(_19){ |
|||
_19(); |
|||
} |
|||
easyloader.onLoad(_18); |
|||
}; |
|||
var _1d=0; |
|||
function _1e(){ |
|||
if(mm.length){ |
|||
var m=mm[0]; |
|||
if(!_3[m]){ |
|||
_1a=true; |
|||
_10(m,function(){ |
|||
mm.shift(); |
|||
_1e(); |
|||
}); |
|||
}else{ |
|||
if(_3[m]=="loaded"){ |
|||
mm.shift(); |
|||
_1e(); |
|||
}else{ |
|||
if(_1d<easyloader.timeout){ |
|||
_1d+=10; |
|||
setTimeout(arguments.callee,10); |
|||
} |
|||
} |
|||
} |
|||
}else{ |
|||
if(easyloader.locale&&_1a==true&&_2[easyloader.locale]){ |
|||
var url=easyloader.base+"locale/"+_2[easyloader.locale]; |
|||
_9(url,function(){ |
|||
_1c(); |
|||
}); |
|||
}else{ |
|||
_1c(); |
|||
} |
|||
} |
|||
}; |
|||
_1e(); |
|||
}; |
|||
easyloader={modules:_1,locales:_2,base:".",theme:"default",css:true,locale:null,timeout:2000,load:function(_1f,_20){ |
|||
if(/\.css$/i.test(_1f)){ |
|||
if(/^http/i.test(_1f)){ |
|||
_c(_1f,_20); |
|||
}else{ |
|||
_c(easyloader.base+_1f,_20); |
|||
} |
|||
}else{ |
|||
if(/\.js$/i.test(_1f)){ |
|||
if(/^http/i.test(_1f)){ |
|||
_4(_1f,_20); |
|||
}else{ |
|||
_4(easyloader.base+_1f,_20); |
|||
} |
|||
}else{ |
|||
_17(_1f,_20); |
|||
} |
|||
} |
|||
},onProgress:function(_21){ |
|||
},onLoad:function(_22){ |
|||
}}; |
|||
var _23=document.getElementsByTagName("script"); |
|||
for(var i=0;i<_23.length;i++){ |
|||
var src=_23[i].src; |
|||
if(!src){ |
|||
continue; |
|||
} |
|||
var m=src.match(/easyloader\.js(\W|$)/i); |
|||
if(m){ |
|||
easyloader.base=src.substring(0,m.index); |
|||
} |
|||
} |
|||
window.using=easyloader.load; |
|||
if(window.jQuery){ |
|||
jQuery(function(){ |
|||
easyloader.load("parser",function(){ |
|||
jQuery.parser.parse(); |
|||
}); |
|||
}); |
|||
} |
|||
})(); |
|||
|
@ -1,778 +0,0 @@ |
|||
function IsPC() { |
|||
var userAgentInfo = navigator.userAgent; |
|||
var Agents = ["Android", "iPhone", |
|||
"SymbianOS", "Windows Phone", |
|||
"iPad", "iPod"]; |
|||
var flag = true; |
|||
for (var v = 0; v < Agents.length; v++) { |
|||
if (userAgentInfo.indexOf(Agents[v]) > 0) { |
|||
flag = false; |
|||
break; |
|||
} |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
if(IsPC()==true){ |
|||
// if(false){
|
|||
// alert("我是PC");
|
|||
}else{ |
|||
// alert("我是手机");
|
|||
let mains=document.getElementsByClassName("mains")[0]; |
|||
let contint=document.getElementsByClassName("contint")[0]; |
|||
|
|||
mains.setAttribute("class","main2") |
|||
contint.setAttribute("class","contint2") |
|||
// renderCanvas.setAttribute("class","renderCanvas2")
|
|||
document.getElementById("renderCanvas").style.width="980px"; |
|||
|
|||
document.getElementById("renderCanvas").style.height="960px"; |
|||
// console.log(document.getElementById("renderCanvas").style.with);
|
|||
//console.log(document.getElementsByClassName("mains").style.flexDirection);
|
|||
document.getElementsByClassName("title")[0].style.display = "none"; |
|||
} |
|||
|
|||
|
|||
// const width = document.documentElement.clientWidth;
|
|||
// const height = document.documentElement.clientHeight;
|
|||
// if (width < height) {
|
|||
// console.log(width + " " + height);
|
|||
// const contentDOM = document.getElementById('divTransform');
|
|||
// contentDOM.style.width = height + 'px';
|
|||
// contentDOM.style.height = width + 'px';
|
|||
// contentDOM.style.top = (height - width) / 2 + 'px';
|
|||
// contentDOM.style.left = 0 - (height - width) / 2 + 'px';
|
|||
// //contentDOM.style.transform = 'rotate(90deg)';
|
|||
// }
|
|||
// const evt = "onorientationchange" in window ? "orientationchange" : "resize";
|
|||
// window.addEventListener(evt, function () {
|
|||
// const width = document.documentElement.clientWidth;
|
|||
// const height = document.documentElement.clientHeight;
|
|||
// const contentDOM = document.getElementById('content');
|
|||
// //alert('width: ' + width + ' height: ' + height)
|
|||
// if (width > height) { // 横屏
|
|||
// contentDOM.style.width = width + 'px';
|
|||
// contentDOM.style.height = height + 'px';
|
|||
// contentDOM.style.top = '0px';
|
|||
// contentDOM.style.left = '0px';
|
|||
// contentDOM.style.transform = 'none';
|
|||
// }
|
|||
// else { // 竖屏,这里微信应该由bug,我切换为竖屏的时候,width:375, height: 323, 导致不能旋转角度。 在safari、chrome上是正确的。
|
|||
// alert('change to portrait')
|
|||
// contentDOM.style.width = height + 'px';
|
|||
// contentDOM.style.height = width + 'px';
|
|||
// contentDOM.style.top = (height - width) / 2 + 'px';
|
|||
// contentDOM.style.left = 0 - (height - width) / 2 + 'px';
|
|||
// //contentDOM.style.transform = 'rotate(90deg)';
|
|||
// }
|
|||
|
|||
// }, false);
|
|||
|
|||
|
|||
|
|||
window.addEventListener('DOMContentLoaded', function(){ |
|||
|
|||
BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function () { |
|||
if (document.getElementById("customLoadingScreenDiv")) { |
|||
// Do not add a loading screen if there is already one
|
|||
document.getElementById("customLoadingScreenDiv").style.display = "initial"; |
|||
return; |
|||
} |
|||
this._loadingDiv = document.createElement("div"); |
|||
this._loadingDiv.id = "customLoadingScreenDiv"; |
|||
//this._loadingDiv.innerHTML = "模型正在加载....";
|
|||
this._loadingDiv.innerHTML = "<image src='./loading.gif' />"; |
|||
var customLoadingScreenCss = document.createElement('style'); |
|||
customLoadingScreenCss.type = 'text/css'; |
|||
customLoadingScreenCss.innerHTML = `
|
|||
#customLoadingScreenDiv{ |
|||
background-color: #3D4456cc; |
|||
color: white; |
|||
font-size:50px; |
|||
text-align:center; |
|||
} |
|||
`;
|
|||
document.getElementsByTagName('head')[0].appendChild(customLoadingScreenCss); |
|||
this._resizeLoadingUI(); |
|||
window.addEventListener("resize", this._resizeLoadingUI); |
|||
document.body.appendChild(this._loadingDiv); |
|||
}; |
|||
|
|||
BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function(){ |
|||
document.getElementById("customLoadingScreenDiv").style.display = "none"; |
|||
console.log("scene is now loaded"); |
|||
} |
|||
function sleep(beginTime,endTime) { |
|||
|
|||
var exitTime = beginTime + 3000; |
|||
while (true) { |
|||
now = new Date(); |
|||
if (now.getTime() > exitTime) |
|||
return; |
|||
} |
|||
} |
|||
|
|||
|
|||
// get the canvas DOM element
|
|||
var canvas = document.getElementById('renderCanvas'); |
|||
|
|||
|
|||
var d = new Date(); |
|||
var n_Begin= d.getTime(); |
|||
console.log("n_Begin:"+n_Begin); |
|||
|
|||
// load the 3D engine
|
|||
var engine = new BABYLON.Engine(canvas, true); |
|||
|
|||
// createScene function that creates and return the scene
|
|||
var createScene = function(){ |
|||
|
|||
engine.displayLoadingUI(); |
|||
// create a basic BJS Scene object
|
|||
var scene = new BABYLON.Scene(engine); |
|||
|
|||
//scene.debugLayer.show();
|
|||
|
|||
|
|||
|
|||
|
|||
var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 5, new BABYLON.Vector3(0, 0, 0), scene); |
|||
console.log(camera); |
|||
// camera.transforms.alpha = 85;
|
|||
//camea.transforms.beta=95;
|
|||
// target the camera to scene origin
|
|||
camera.setTarget(BABYLON.Vector3.Zero()); |
|||
//camera.setPosition(new BABYLON.Vector3(20, 200, 400));
|
|||
// attach the camera to the canvas
|
|||
camera.attachControl(canvas, true); |
|||
|
|||
|
|||
|
|||
camera.lowerRadiusLimit = 2.5 ;// 这里是最大的位置,值越大,物体越小
|
|||
camera.upperRadiusLimit = 20 ; |
|||
camera.Radius = 2.5; |
|||
camera.alpha = 1.5; |
|||
camera.beta = 1; |
|||
camera.inertia=0.1; // 缩放的快慢
|
|||
//scene.VRHelper = scene.createDefaultVRExperience({createDeviceOrientationCamera: false});
|
|||
//var VRHelper = scene.createDefaultVRExperience();
|
|||
//console.log(VRHelper);
|
|||
//VRHelper.onExitingVR.add(()=>{
|
|||
// scene.setActiveCameraByName("Camera");
|
|||
// console.log("abc");
|
|||
//console.log(scene);
|
|||
//})
|
|||
|
|||
|
|||
//scene.setActiveCameraByName("Camera");
|
|||
//console.log(VRHelper);
|
|||
|
|||
// create a basic light, aiming 0,1,0 - meaning, to the sky
|
|||
var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0,1,0), scene); |
|||
|
|||
|
|||
// Skybox
|
|||
var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", {size:1000.0}, scene); |
|||
var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); |
|||
skyboxMaterial.backFaceCulling = false; |
|||
skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene); |
|||
skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; |
|||
skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); |
|||
skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); |
|||
skybox.material = skyboxMaterial; |
|||
|
|||
|
|||
var myColor = BABYLON.Color3.Blue(); |
|||
var line03_position = BABYLON.Vector3(0,0,0); |
|||
var line01_position = BABYLON.Vector3(0,0,0); |
|||
var line17_position = BABYLON.Vector3(0,0,0); |
|||
var line26_position = BABYLON.Vector3(0,0,0); |
|||
|
|||
|
|||
console.log("position:"+line03_position); |
|||
// Initialize GizmoManager
|
|||
var gizmoManager = new BABYLON.GizmoManager(scene) |
|||
BABYLON.SceneLoader.Append("./asset/", "abc2.gltf", scene, function (scene) { |
|||
|
|||
//坐场
|
|||
line03 = scene.getMeshByName("Line03"); |
|||
line03_position = line03.position; |
|||
|
|||
Line03Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Line03Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4,0.4); |
|||
Line03Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line03Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
|
|||
line03.material = Line03Mat; |
|||
|
|||
//左护版
|
|||
line01 = scene.getMeshByName("Line01"); |
|||
line01_position = line01.position; |
|||
Line01Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Line01Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line01Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line01Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
line01.material = Line01Mat; |
|||
|
|||
//左护版
|
|||
//line05 = scene.getMeshByName("Line05");
|
|||
|
|||
//Line05Mat = new BABYLON.StandardMaterial("ground", scene);
|
|||
//Line05Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
|
|||
//Line05Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
|
|||
//Line05Mat.emissiveColor = BABYLON.Color3.Blue();
|
|||
//line05.material = Line05Mat;
|
|||
|
|||
|
|||
//右腿
|
|||
line17 = scene.getMeshByName("Line17"); |
|||
line17_position = line17.position; |
|||
Line17Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Line17Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line17Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line17Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
line17.material = Line17Mat; |
|||
|
|||
//line17.position.x =1;
|
|||
|
|||
//右腿
|
|||
line26 = scene.getMeshByName("Cylinder56"); |
|||
line26_position = line26.position; |
|||
Line26Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Line26Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line26Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line26Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
line26.material = Line26Mat; |
|||
|
|||
//枪
|
|||
tube15 = scene.getMeshByName("Tube15"); |
|||
tube15_position = tube15.position; |
|||
Tube15Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Tube15Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Tube15Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Tube15Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
tube15.material = Tube15Mat; |
|||
|
|||
root = scene.getMeshByName("__root__"); |
|||
|
|||
//console.log("abccc");
|
|||
//console.log(scene);
|
|||
//root.addRotation(0.01, 0, 0);
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
//gizmoManager.boundingBoxGizmoEnabled=true
|
|||
// Restrict gizmos to only spheres
|
|||
gizmoManager.attachableMeshes =[line03,line01,tube15,line26,line17]; |
|||
// Toggle gizmos with keyboard buttons
|
|||
document.onkeydown = (e)=>{ |
|||
if(e.key == 'w'){ |
|||
gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled |
|||
} |
|||
if(e.key == 'e'){ |
|||
gizmoManager.rotationGizmoEnabled = !gizmoManager.rotationGizmoEnabled |
|||
} |
|||
if(e.key == 'r'){ |
|||
gizmoManager.scaleGizmoEnabled = !gizmoManager.scaleGizmoEnabled |
|||
} |
|||
if(e.key == 'q'){ |
|||
gizmoManager.boundingBoxGizmoEnabled = !gizmoManager.boundingBoxGizmoEnabled |
|||
} |
|||
} |
|||
var oldMeth = null; |
|||
// On pick interpolations
|
|||
var prepareButton = function (mesh, color,strss) { |
|||
//var goToColorAction = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", color, 1000, null, true);
|
|||
|
|||
mesh.actionManager = new BABYLON.ActionManager(scene); |
|||
|
|||
// mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor));
|
|||
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Red())); |
|||
// mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Yellow()));
|
|||
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(0.38, 0.38, 0.38), 100)); |
|||
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(0.4, 0.4, 0.4), 100)); |
|||
//mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "wireframe", true))
|
|||
mesh.actionManager.registerAction( |
|||
new BABYLON.ExecuteCodeAction( |
|||
{ |
|||
trigger:BABYLON.ActionManager.OnPickTrigger, |
|||
parameter:"" |
|||
}, |
|||
function(){ |
|||
document.getElementById("show").innerHTML=strss; |
|||
console.log(oldMeth); |
|||
console.log(mesh); |
|||
if(oldMeth != null && oldMeth.id != mesh.id){ |
|||
oldMeth.material.emissiveColor= myColor; |
|||
} |
|||
oldMeth = mesh; |
|||
// mesh.material.emissiveColor= BABYLON.Color3.Red()
|
|||
//mesh.material.emissiveColor = myColor;
|
|||
//console.log(mesh.material.emissiveColor);
|
|||
//mesh.material = BABYLON.Color3.Yellow()
|
|||
//a.innerHTML ="这里是坐长的位置,可以坐人的."
|
|||
} |
|||
) |
|||
); |
|||
} |
|||
var prepareButton2 = function (mesh, color,strss) { |
|||
//var goToColorAction = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", color, 1000, null, true);
|
|||
|
|||
mesh.actionManager = new BABYLON.ActionManager(scene); |
|||
|
|||
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor)); |
|||
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Red())); |
|||
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(1,1, 1), 100)); |
|||
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(1, 1, 1), 100)); |
|||
|
|||
mesh.actionManager.registerAction( |
|||
new BABYLON.ExecuteCodeAction( |
|||
{ |
|||
trigger:BABYLON.ActionManager.OnPickTrigger, |
|||
parameter:"" |
|||
}, |
|||
function(){ |
|||
document.getElementById("show").innerHTML=strss; |
|||
//a.innerHTML ="这里是坐长的位置,可以坐人的."
|
|||
} |
|||
) |
|||
); |
|||
} |
|||
|
|||
prepareButton(line03, BABYLON.Color3.Blue(),`<font size="20">坐舱:</font></br> 又叫驾驶舱(Cockpit)是操作员控制机器人的座舱,通常位于前端。除了早期的,如今大部分机器人的驾驶舱采用密闭式的设计。机器人驾驶舱内一般安装有各类控制系统。 驾驶舱是机器人的首脑元件,为太空船里下令及控制的中心。它是设计用来尽量让驾驶员感到操控舒适,并包含所有先进导航及各项操控的系统,就如同其他提供居住人员所有必需品的组件是一样重要的。</h2>`); |
|||
prepareButton(line01, BABYLON.Color3.Blue(),`<font size="20">铠甲:</font><br> 机械外骨骼或称动力外骨骼(Powered exoskeleton),是一种由钢铁的框架构成并且可让人穿上的机器装置,这个装备可以提供额外能量来供四肢运动。别称:强化服、动力服(Power Suit)、动力装甲(Power armor或Powered armor)、Exoframe、Hardsuit或Exosuit等。凭借这套“服装”,人类就可以成为所谓的“铁人”。
|
|||
<br/><br/> 动力外骨骼更倾向于军用,除了能够增强人体能力的这一基本功能外,还要具有良好的防护性、对复杂环境的适应性以及辅助火力、通信、侦查支持等军用功能。 |
|||
<br/><br/> 动力服是设计成用来保护穿戴者的,例如为了保护士兵或建筑工而设计,或设计用来进行救援身处险境的人员上。广泛一些的用途则是用来做为义肢与帮助老弱者行动。其它的用途则是用来进行救援行动,就像在一栋要倒塌的建筑物里,这个装置可以提供给工人很大的力量来举起重物,同时保护它不被落下的碎石砸伤。在日本,有银行为需常搬运沉重钞票及硬币的员工配备外骨骼,以降低身体负担。`);
|
|||
//prepareButton(line05, BABYLON.Color3.Blue(),"右护版");
|
|||
prepareButton(line17, BABYLON.Color3.Blue(),`<font size="20">左脚:</font>
|
|||
<br><br> 用激光器作为辐射源的雷达。激光雷达是激光技术与雷达技术相结合的产物 。由发射机 、天线 、接收机 、跟踪架及信息处理等部分组成。发射机是各种形式的激光器,如二氧化碳激光器、掺钕钇铝石榴石激光器、半导体激光器及波长可调谐的固体激光器等;天线是光学望远镜;接收机采用各种形式的光电探测器,如光电倍增管、半导体光电二极管、雪崩光电二极管、红外和可见光多元探测器件等。激光雷达采用脉冲或连续波2种工作方式,探测方法分直接探测与外差探测。 |
|||
<br><img src='./img/2.jpg' height='400'>`);
|
|||
prepareButton(line26, BABYLON.Color3.Blue(),`<font size="20">机器关节:</font><br/><br/> 机器人关节驱动器是一种集电液伺服阀及摆动缸于一体的液压或气动装置。关节机器人常见的有协作机器人(六轴、七轴)、外骨骼机器人、四足、双足、手术机器人等,里面用的东西基本都包含力矩电机、编码器、减速器、驱动器等,有的可能会用到抱闸、力矩传感器。但是每个应用匹配的方案不一样,用的产品也是多种多样。<br/><img src='./img/4.jpg'>`); |
|||
prepareButton(tube15, BABYLON.Color3.Blue(),`<p class='p13'><font size="20">机枪:</font><br/><br/> 机枪(Machine gun) 一种带有枪架或枪座,能实现连发射击的自动枪械。世界第一挺机枪是个叫伐商的比利时工程师(曾是拿破伦手下的上尉)于1851年设计的。该枪曾在1870、1871年的普法战争中用过。而普遍观点认为,现代机枪的鼻祖是加特林多管式机枪。1862年,由美国人理查德·杰丹·加特林发明,这种枪有几个枪筒,可以轮转。1883年,美国人海尔曼·S·马克沁进行革新,机枪变为单枪筒,利用后坐力,使上膛、射击和退弹能同时完成,枪身用枪筒上的水套降温,每分钟可射击650次,名为马克沁机枪.<br/></p><video src='a.mp4' controls='controls'></video> `); |
|||
|
|||
var d1 = new Date(); |
|||
var n_end= d1.getTime(); |
|||
console.log("n_end:"+n_end); |
|||
console.log(n_end - n_Begin); |
|||
|
|||
sleep(n_Begin,n_end); |
|||
|
|||
engine.hideLoadingUI(); |
|||
|
|||
}); |
|||
|
|||
|
|||
|
|||
//GUI
|
|||
|
|||
// Another GUI on the right
|
|||
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI"); |
|||
advancedTexture.layer.layerMask = 2; |
|||
|
|||
var panel3 = new BABYLON.GUI.StackPanel(); |
|||
panel3.width = "800px"; |
|||
panel3.fontSize = "30px"; |
|||
panel3.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
panel3.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; |
|||
advancedTexture.addControl(panel3); |
|||
|
|||
|
|||
var button1 = BABYLON.GUI.Button.CreateSimpleButton("but1", "旋 转"); |
|||
button1.width = 0.2; |
|||
button1.height = "80px"; |
|||
button1.color = "white"; |
|||
button1.cornerRadius = 20; |
|||
button1.background = "green"; |
|||
button1.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
//button1.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
|
|||
|
|||
//button1.centerY=5;
|
|||
//console.log(button1);
|
|||
//button1.position.x = 300;
|
|||
//button1.position.y = 5;
|
|||
|
|||
|
|||
var aaab = false; |
|||
button1.onPointerUpObservable.add(function() { |
|||
// circle.scaleX += 0.1;
|
|||
if(aaab== false){ |
|||
scene.registerBeforeRender(function(){ |
|||
root.addRotation(0.00, 0.008, 0); |
|||
button1.textBlock.text = "停 止"; |
|||
aaab = true; |
|||
button1.background = "red"; |
|||
}); |
|||
}else{ |
|||
scene.registerBeforeRender(function(){ |
|||
root.addRotation(0.00, -0.008, 0); |
|||
button1.textBlock.text = "旋 转"; |
|||
aaab = false; |
|||
button1.background = "green"; |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
|
|||
|
|||
var button3 = BABYLON.GUI.Button.CreateSimpleButton("but2", "展 开"); |
|||
button3.width = 0.2; |
|||
button3.height = "80px"; |
|||
button3.color = "white"; |
|||
button3.cornerRadius = 20; |
|||
button3.background = "green"; |
|||
var bob = false; |
|||
button3.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
button3.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; |
|||
|
|||
|
|||
|
|||
button3.onPointerUpObservable.add(function() { |
|||
// circle.scaleX += 0.1;
|
|||
//gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled
|
|||
if(bob== false){ |
|||
bob = true; |
|||
button3.textBlock.text = "合 体"; |
|||
|
|||
button3.background = "red"; |
|||
|
|||
var animationBox = new BABYLON.Animation("tutoAnimation", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys = []; |
|||
|
|||
keys.push({ |
|||
frame: 0, |
|||
value: line03_position |
|||
}); |
|||
|
|||
keys.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(line03_position.x+60,line03_position.y,line03_position.z) |
|||
}); |
|||
|
|||
animationBox.setKeys(keys); |
|||
|
|||
line03.animations.push(animationBox); //中间坐舱
|
|||
//scene.beginAnimation(line03, 0, 100, false);
|
|||
|
|||
//左护版
|
|||
var animationBox2 = new BABYLON.Animation("Animation2", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys1 = []; |
|||
|
|||
keys1.push({ |
|||
frame: 0, |
|||
value: line01_position |
|||
}); |
|||
|
|||
keys1.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(line01_position.x-40,line01_position.y,line01_position.z) |
|||
}); |
|||
|
|||
animationBox2.setKeys(keys1); |
|||
|
|||
line01.animations.push(animationBox2); //中间坐舱
|
|||
//scene.beginAnimation(line01, 0, 100, true);
|
|||
|
|||
|
|||
//左脚
|
|||
var animationBox3 = new BABYLON.Animation("animationBox3", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys2 = []; |
|||
|
|||
keys2.push({ |
|||
frame: 0, |
|||
value: line17_position |
|||
}); |
|||
|
|||
keys2.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(line17_position.x-50,line17_position.y,line17_position.z) |
|||
}); |
|||
|
|||
animationBox3.setKeys(keys2); |
|||
|
|||
line17.animations.push(animationBox3); //中间坐舱
|
|||
//scene.beginAnimation(line17, 0, 100, true);
|
|||
|
|||
//右脚
|
|||
var animationBox4 = new BABYLON.Animation("animationBox4", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys4 = []; |
|||
|
|||
keys4.push({ |
|||
frame: 0, |
|||
value: line26_position |
|||
}); |
|||
|
|||
keys4.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(line26_position.x+50,line26_position.y,line26_position.z) |
|||
}); |
|||
|
|||
animationBox4.setKeys(keys4); |
|||
|
|||
line26.animations.push(animationBox4); //中间坐舱
|
|||
//scene.beginAnimation(line26, 0, 100, true);
|
|||
|
|||
|
|||
//枪
|
|||
var animationBox5 = new BABYLON.Animation("animationBox5", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys5 = []; |
|||
|
|||
keys5.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(-23,0,-47.5) |
|||
}); |
|||
|
|||
keys5.push({ |
|||
frame: 20, |
|||
value:new BABYLON.Vector3(-2,0,-90) |
|||
}); |
|||
|
|||
animationBox5.setKeys(keys5); |
|||
|
|||
tube15.animations.push(animationBox5); //中间坐舱
|
|||
//scene.beginAnimation(tube15, 0, 100, true);
|
|||
|
|||
|
|||
|
|||
setTimeout(async () => { |
|||
var anim1 = scene.beginAnimation(line01, 0, 100, false); |
|||
var anim2 = scene.beginAnimation(line03, 0, 100, false); |
|||
var anim3 = scene.beginAnimation(line17, 0, 100, false); |
|||
var anim4 = scene.beginAnimation(line26, 0, 100, false); |
|||
var anim5 = scene.beginAnimation(tube15, 0, 100, false); |
|||
console.log("ddd"); |
|||
//await anim1.waitAsync();
|
|||
//await anim2.waitAsync();
|
|||
//await anim3.waitAsync();
|
|||
//await anim4.waitAsync();
|
|||
await anim5.waitAsync(); |
|||
console.log("dd33d"); |
|||
scene.stopAnimation(line01); |
|||
scene.stopAnimation(line03); |
|||
scene.stopAnimation(line17); |
|||
scene.stopAnimation(line26); |
|||
scene.stopAnimation(tube15); |
|||
}); |
|||
|
|||
|
|||
}else{ |
|||
bob = false; |
|||
button3.background = "green"; |
|||
var animationBox = new BABYLON.Animation("tutoAnimation", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys = []; |
|||
|
|||
keys.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(line03_position.x-60,line03_position.y,line03_position.z) |
|||
}); |
|||
|
|||
keys.push({ |
|||
frame: 20, |
|||
value: line03_position |
|||
}); |
|||
|
|||
animationBox.setKeys(keys); |
|||
|
|||
line03.animations.push(animationBox); //中间坐舱
|
|||
//scene.beginAnimation(line03, 0, 100, true);
|
|||
|
|||
//左护版
|
|||
var animationBox2 = new BABYLON.Animation("Animation2", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys1 = []; |
|||
|
|||
keys1.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(line01_position.x+40,line01_position.y,line01_position.z) |
|||
}); |
|||
|
|||
keys1.push({ |
|||
frame: 20, |
|||
value:line01_position |
|||
}); |
|||
|
|||
animationBox2.setKeys(keys1); |
|||
|
|||
line01.animations.push(animationBox2); //中间坐舱
|
|||
//scene.beginAnimation(line01, 0, 100, true);
|
|||
|
|||
|
|||
//左脚
|
|||
var animationBox3 = new BABYLON.Animation("animationBox3", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys2 = []; |
|||
|
|||
keys2.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(line17_position.x+50,line17_position.y,line17_position.z) |
|||
}); |
|||
|
|||
keys2.push({ |
|||
frame: 20, |
|||
value:line17_position |
|||
}); |
|||
|
|||
animationBox3.setKeys(keys2); |
|||
|
|||
line17.animations.push(animationBox3); //中间坐舱
|
|||
// scene.beginAnimation(line17, 0, 100, true);
|
|||
|
|||
//右脚
|
|||
var animationBox4 = new BABYLON.Animation("animationBox4", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys4 = []; |
|||
|
|||
keys4.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(line26_position.x-50,line26_position.y,line26_position.z) |
|||
}); |
|||
|
|||
keys4.push({ |
|||
frame: 20, |
|||
value: line26_position |
|||
}); |
|||
|
|||
animationBox4.setKeys(keys4); |
|||
|
|||
line26.animations.push(animationBox4); //中间坐舱
|
|||
//scene.beginAnimation(line26, 0, 100, true);
|
|||
|
|||
//枪
|
|||
var animationBox5 = new BABYLON.Animation("animationBox5", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys5 = []; |
|||
|
|||
keys5.push({ |
|||
frame: 0, |
|||
value:new BABYLON.Vector3(-2,0,-90) |
|||
|
|||
}); |
|||
|
|||
keys5.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(-23,0,-47.5) |
|||
}); |
|||
|
|||
animationBox5.setKeys(keys5); |
|||
|
|||
tube15.animations.push(animationBox5); //中间坐舱
|
|||
|
|||
button3.textBlock.text = "展 开"; |
|||
|
|||
setTimeout(async () => { |
|||
var anim1 = scene.beginAnimation(line01, 0, 100, false); |
|||
var anim2 = scene.beginAnimation(line03, 0, 100, false); |
|||
var anim3 = scene.beginAnimation(line17, 0, 100, false); |
|||
var anim4 = scene.beginAnimation(line26, 0, 100, false); |
|||
var anim5 = scene.beginAnimation(tube15, 0, 100, false); |
|||
console.log("ddd"); |
|||
await anim1.waitAsync(); |
|||
await anim2.waitAsync(); |
|||
await anim3.waitAsync(); |
|||
await anim4.waitAsync(); |
|||
await anim5.waitAsync(); |
|||
console.log("dd33d"); |
|||
scene.stopAnimation(line01); |
|||
scene.stopAnimation(line03); |
|||
scene.stopAnimation(line17); |
|||
scene.stopAnimation(line26); |
|||
scene.stopAnimation(tube15); |
|||
}); |
|||
|
|||
|
|||
} |
|||
}); |
|||
|
|||
var button2 = BABYLON.GUI.Button.CreateSimpleButton("but2", "拆 解"); |
|||
button2.width =0.2; |
|||
button2.height = "80px"; |
|||
button2.color = "white"; |
|||
button2.cornerRadius = 20; |
|||
button2.background = "green"; |
|||
|
|||
button2.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
button2.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; |
|||
|
|||
var selectOne = false; |
|||
|
|||
button2.onPointerUpObservable.add(function() { |
|||
// circle.scaleX += 0.1;
|
|||
gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled |
|||
if(selectOne== false){ |
|||
//scene.stopAnimation(line01);
|
|||
//scene.stopAnimation(line03);
|
|||
//scene.stopAnimation(line17);
|
|||
//scene.stopAnimation(line26);
|
|||
//scene.stopAnimation(tube15);
|
|||
|
|||
selectOne = true; |
|||
button2.background = "red"; |
|||
button2.textBlock.text = "取 消"; |
|||
}else{ |
|||
//window.location.reload(true);
|
|||
|
|||
selectOne = false; |
|||
button2.background = "green"; |
|||
button2.textBlock.text = "拆 解"; |
|||
} |
|||
}); |
|||
|
|||
var button4 = BABYLON.GUI.Button.CreateSimpleButton("but4", "还 原"); |
|||
//button4.fontSize = "26px";
|
|||
button4.width = 0.2; |
|||
button4.height = "80px"; |
|||
button4.color = "white"; |
|||
button4.cornerRadius = 20; |
|||
button4.background = "green"; |
|||
button4.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
button4.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; |
|||
button4.onPointerUpObservable.add(function() { |
|||
window.location.reload(true); |
|||
}); |
|||
|
|||
|
|||
panel3.addControl(button1); |
|||
|
|||
panel3.addControl(button3); |
|||
panel3.addControl(button2); |
|||
panel3.addControl(button4); |
|||
return scene; |
|||
} |
|||
|
|||
// call the createScene function
|
|||
var scene = createScene(); |
|||
//var a = scene.getElementById("__root");
|
|||
// run the render loop
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/**/ |
|||
|
|||
engine.runRenderLoop(function(){ |
|||
scene.render(); |
|||
}); |
|||
var abc1 = scene.getMeshByName("plane"); |
|||
|
|||
window.addEventListener('resize', function(){ |
|||
engine.resize(); |
|||
}); |
|||
}); |
18706
public/webThird/js/jquery-ui.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
11008
public/webThird/js/jquery.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,138 +0,0 @@ |
|||
/** |
|||
* jQuery.timers - Timer abstractions for jQuery |
|||
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) |
|||
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
|
|||
* Date: 2009/10/16 |
|||
* |
|||
* @author Blair Mitchelmore |
|||
* @version 1.2 |
|||
* |
|||
**/ |
|||
|
|||
jQuery.fn.extend({ |
|||
everyTime: function(interval, label, fn, times) { |
|||
return this.each(function() { |
|||
jQuery.timer.add(this, interval, label, fn, times); |
|||
}); |
|||
}, |
|||
oneTime: function(interval, label, fn) { |
|||
return this.each(function() { |
|||
jQuery.timer.add(this, interval, label, fn, 1); |
|||
}); |
|||
}, |
|||
stopTime: function(label, fn) { |
|||
return this.each(function() { |
|||
jQuery.timer.remove(this, label, fn); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
jQuery.extend({ |
|||
timer: { |
|||
global: [], |
|||
guid: 1, |
|||
dataKey: "jQuery.timer", |
|||
regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, |
|||
powers: { |
|||
// Yeah this is major overkill...
|
|||
'ms': 1, |
|||
'cs': 10, |
|||
'ds': 100, |
|||
's': 1000, |
|||
'das': 10000, |
|||
'hs': 100000, |
|||
'ks': 1000000 |
|||
}, |
|||
timeParse: function(value) { |
|||
if (value == undefined || value == null) |
|||
return null; |
|||
var result = this.regex.exec(jQuery.trim(value.toString())); |
|||
if (result[2]) { |
|||
var num = parseFloat(result[1]); |
|||
var mult = this.powers[result[2]] || 1; |
|||
return num * mult; |
|||
} else { |
|||
return value; |
|||
} |
|||
}, |
|||
add: function(element, interval, label, fn, times) { |
|||
var counter = 0; |
|||
|
|||
if (jQuery.isFunction(label)) { |
|||
if (!times) |
|||
times = fn; |
|||
fn = label; |
|||
label = interval; |
|||
} |
|||
|
|||
interval = jQuery.timer.timeParse(interval); |
|||
|
|||
if (typeof interval != 'number' || isNaN(interval) || interval < 0) |
|||
return; |
|||
|
|||
if (typeof times != 'number' || isNaN(times) || times < 0) |
|||
times = 0; |
|||
|
|||
times = times || 0; |
|||
|
|||
var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {}); |
|||
|
|||
if (!timers[label]) |
|||
timers[label] = {}; |
|||
|
|||
fn.timerID = fn.timerID || this.guid++; |
|||
|
|||
var handler = function() { |
|||
if ((++counter > times && times !== 0) || fn.call(element, counter) === false) |
|||
jQuery.timer.remove(element, label, fn); |
|||
}; |
|||
|
|||
handler.timerID = fn.timerID; |
|||
|
|||
if (!timers[label][fn.timerID]) |
|||
timers[label][fn.timerID] = window.setInterval(handler,interval); |
|||
|
|||
this.global.push( element ); |
|||
|
|||
}, |
|||
remove: function(element, label, fn) { |
|||
var timers = jQuery.data(element, this.dataKey), ret; |
|||
|
|||
if ( timers ) { |
|||
|
|||
if (!label) { |
|||
for ( label in timers ) |
|||
this.remove(element, label, fn); |
|||
} else if ( timers[label] ) { |
|||
if ( fn ) { |
|||
if ( fn.timerID ) { |
|||
window.clearInterval(timers[label][fn.timerID]); |
|||
delete timers[label][fn.timerID]; |
|||
} |
|||
} else { |
|||
for ( var fn in timers[label] ) { |
|||
window.clearInterval(timers[label][fn]); |
|||
delete timers[label][fn]; |
|||
} |
|||
} |
|||
|
|||
for ( ret in timers[label] ) break; |
|||
if ( !ret ) { |
|||
ret = null; |
|||
delete timers[label]; |
|||
} |
|||
} |
|||
|
|||
for ( ret in timers ) break; |
|||
if ( !ret ) |
|||
jQuery.removeData(element, this.dataKey); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
jQuery(window).bind("unload", function() { |
|||
jQuery.each(jQuery.timer.global, function(index, item) { |
|||
jQuery.timer.remove(item); |
|||
}); |
|||
}); |
2061
public/webWater/js/bootstrap-slider.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,190 +0,0 @@ |
|||
/** |
|||
* EasyUI for jQuery 1.7.0 |
|||
* |
|||
* Copyright (c) 2009-2018 www.jeasyui.com. All rights reserved. |
|||
* |
|||
* Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
|
|||
* To use it on other terms please contact us: info@jeasyui.com |
|||
* |
|||
*/ |
|||
(function(){ |
|||
var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},datalist:{js:"jquery.datalist.js",css:"datalist.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","dialog","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},switchbutton:{js:"jquery.switchbutton.js",css:"switchbutton.css"},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},passwordbox:{js:"jquery.passwordbox.js",css:"passwordbox.css",dependencies:["textbox"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},radiobutton:{js:"jquery.radiobutton.js",css:"radiobutton.css"},checkbox:{js:"jquery.checkbox.js",css:"checkbox.css"},sidemenu:{js:"jquery.sidemenu.js",css:"sidemenu.css",dependencies:["accordion","tree","tooltip"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},combotreegrid:{js:"jquery.combotreegrid.js",dependencies:["combo","treegrid"]},tagbox:{js:"jquery.tagbox.js",dependencies:["combobox"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},parser:{js:"jquery.parser.js"},mobile:{js:"jquery.mobile.js"}}; |
|||
var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"}; |
|||
var _3={}; |
|||
function _4(_5,_6){ |
|||
var _7=false; |
|||
var _8=document.createElement("script"); |
|||
_8.type="text/javascript"; |
|||
_8.language="javascript"; |
|||
_8.src=_5; |
|||
_8.onload=_8.onreadystatechange=function(){ |
|||
if(!_7&&(!_8.readyState||_8.readyState=="loaded"||_8.readyState=="complete")){ |
|||
_7=true; |
|||
_8.onload=_8.onreadystatechange=null; |
|||
if(_6){ |
|||
_6.call(_8); |
|||
} |
|||
} |
|||
}; |
|||
document.getElementsByTagName("head")[0].appendChild(_8); |
|||
}; |
|||
function _9(_a,_b){ |
|||
_4(_a,function(){ |
|||
document.getElementsByTagName("head")[0].removeChild(this); |
|||
if(_b){ |
|||
_b(); |
|||
} |
|||
}); |
|||
}; |
|||
function _c(_d,_e){ |
|||
var _f=document.createElement("link"); |
|||
_f.rel="stylesheet"; |
|||
_f.type="text/css"; |
|||
_f.media="screen"; |
|||
_f.href=_d; |
|||
document.getElementsByTagName("head")[0].appendChild(_f); |
|||
if(_e){ |
|||
_e.call(_f); |
|||
} |
|||
}; |
|||
function _10(_11,_12){ |
|||
_3[_11]="loading"; |
|||
var _13=_1[_11]; |
|||
var _14="loading"; |
|||
var _15=(easyloader.css&&_13["css"])?"loading":"loaded"; |
|||
if(easyloader.css&&_13["css"]){ |
|||
if(/^http/i.test(_13["css"])){ |
|||
var url=_13["css"]; |
|||
}else{ |
|||
var url=easyloader.base+"themes/"+easyloader.theme+"/"+_13["css"]; |
|||
} |
|||
_c(url,function(){ |
|||
_15="loaded"; |
|||
if(_14=="loaded"&&_15=="loaded"){ |
|||
_16(); |
|||
} |
|||
}); |
|||
} |
|||
if(/^http/i.test(_13["js"])){ |
|||
var url=_13["js"]; |
|||
}else{ |
|||
var url=easyloader.base+"plugins/"+_13["js"]; |
|||
} |
|||
_4(url,function(){ |
|||
_14="loaded"; |
|||
if(_14=="loaded"&&_15=="loaded"){ |
|||
_16(); |
|||
} |
|||
}); |
|||
function _16(){ |
|||
_3[_11]="loaded"; |
|||
easyloader.onProgress(_11); |
|||
if(_12){ |
|||
_12(); |
|||
} |
|||
}; |
|||
}; |
|||
function _17(_18,_19){ |
|||
var mm=[]; |
|||
var _1a=false; |
|||
if(typeof _18=="string"){ |
|||
add(_18); |
|||
}else{ |
|||
for(var i=0;i<_18.length;i++){ |
|||
add(_18[i]); |
|||
} |
|||
} |
|||
function add(_1b){ |
|||
if(!_1[_1b]){ |
|||
return; |
|||
} |
|||
var d=_1[_1b]["dependencies"]; |
|||
if(d){ |
|||
for(var i=0;i<d.length;i++){ |
|||
add(d[i]); |
|||
} |
|||
} |
|||
mm.push(_1b); |
|||
}; |
|||
function _1c(){ |
|||
if(_19){ |
|||
_19(); |
|||
} |
|||
easyloader.onLoad(_18); |
|||
}; |
|||
var _1d=0; |
|||
function _1e(){ |
|||
if(mm.length){ |
|||
var m=mm[0]; |
|||
if(!_3[m]){ |
|||
_1a=true; |
|||
_10(m,function(){ |
|||
mm.shift(); |
|||
_1e(); |
|||
}); |
|||
}else{ |
|||
if(_3[m]=="loaded"){ |
|||
mm.shift(); |
|||
_1e(); |
|||
}else{ |
|||
if(_1d<easyloader.timeout){ |
|||
_1d+=10; |
|||
setTimeout(arguments.callee,10); |
|||
} |
|||
} |
|||
} |
|||
}else{ |
|||
if(easyloader.locale&&_1a==true&&_2[easyloader.locale]){ |
|||
var url=easyloader.base+"locale/"+_2[easyloader.locale]; |
|||
_9(url,function(){ |
|||
_1c(); |
|||
}); |
|||
}else{ |
|||
_1c(); |
|||
} |
|||
} |
|||
}; |
|||
_1e(); |
|||
}; |
|||
easyloader={modules:_1,locales:_2,base:".",theme:"default",css:true,locale:null,timeout:2000,load:function(_1f,_20){ |
|||
if(/\.css$/i.test(_1f)){ |
|||
if(/^http/i.test(_1f)){ |
|||
_c(_1f,_20); |
|||
}else{ |
|||
_c(easyloader.base+_1f,_20); |
|||
} |
|||
}else{ |
|||
if(/\.js$/i.test(_1f)){ |
|||
if(/^http/i.test(_1f)){ |
|||
_4(_1f,_20); |
|||
}else{ |
|||
_4(easyloader.base+_1f,_20); |
|||
} |
|||
}else{ |
|||
_17(_1f,_20); |
|||
} |
|||
} |
|||
},onProgress:function(_21){ |
|||
},onLoad:function(_22){ |
|||
}}; |
|||
var _23=document.getElementsByTagName("script"); |
|||
for(var i=0;i<_23.length;i++){ |
|||
var src=_23[i].src; |
|||
if(!src){ |
|||
continue; |
|||
} |
|||
var m=src.match(/easyloader\.js(\W|$)/i); |
|||
if(m){ |
|||
easyloader.base=src.substring(0,m.index); |
|||
} |
|||
} |
|||
window.using=easyloader.load; |
|||
if(window.jQuery){ |
|||
jQuery(function(){ |
|||
easyloader.load("parser",function(){ |
|||
jQuery.parser.parse(); |
|||
}); |
|||
}); |
|||
} |
|||
})(); |
|||
|
@ -1,778 +0,0 @@ |
|||
function IsPC() { |
|||
var userAgentInfo = navigator.userAgent; |
|||
var Agents = ["Android", "iPhone", |
|||
"SymbianOS", "Windows Phone", |
|||
"iPad", "iPod"]; |
|||
var flag = true; |
|||
for (var v = 0; v < Agents.length; v++) { |
|||
if (userAgentInfo.indexOf(Agents[v]) > 0) { |
|||
flag = false; |
|||
break; |
|||
} |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
if(IsPC()==true){ |
|||
// if(false){
|
|||
// alert("我是PC");
|
|||
}else{ |
|||
// alert("我是手机");
|
|||
let mains=document.getElementsByClassName("mains")[0]; |
|||
let contint=document.getElementsByClassName("contint")[0]; |
|||
|
|||
mains.setAttribute("class","main2") |
|||
contint.setAttribute("class","contint2") |
|||
// renderCanvas.setAttribute("class","renderCanvas2")
|
|||
document.getElementById("renderCanvas").style.width="980px"; |
|||
|
|||
document.getElementById("renderCanvas").style.height="960px"; |
|||
// console.log(document.getElementById("renderCanvas").style.with);
|
|||
//console.log(document.getElementsByClassName("mains").style.flexDirection);
|
|||
document.getElementsByClassName("title")[0].style.display = "none"; |
|||
} |
|||
|
|||
|
|||
// const width = document.documentElement.clientWidth;
|
|||
// const height = document.documentElement.clientHeight;
|
|||
// if (width < height) {
|
|||
// console.log(width + " " + height);
|
|||
// const contentDOM = document.getElementById('divTransform');
|
|||
// contentDOM.style.width = height + 'px';
|
|||
// contentDOM.style.height = width + 'px';
|
|||
// contentDOM.style.top = (height - width) / 2 + 'px';
|
|||
// contentDOM.style.left = 0 - (height - width) / 2 + 'px';
|
|||
// //contentDOM.style.transform = 'rotate(90deg)';
|
|||
// }
|
|||
// const evt = "onorientationchange" in window ? "orientationchange" : "resize";
|
|||
// window.addEventListener(evt, function () {
|
|||
// const width = document.documentElement.clientWidth;
|
|||
// const height = document.documentElement.clientHeight;
|
|||
// const contentDOM = document.getElementById('content');
|
|||
// //alert('width: ' + width + ' height: ' + height)
|
|||
// if (width > height) { // 横屏
|
|||
// contentDOM.style.width = width + 'px';
|
|||
// contentDOM.style.height = height + 'px';
|
|||
// contentDOM.style.top = '0px';
|
|||
// contentDOM.style.left = '0px';
|
|||
// contentDOM.style.transform = 'none';
|
|||
// }
|
|||
// else { // 竖屏,这里微信应该由bug,我切换为竖屏的时候,width:375, height: 323, 导致不能旋转角度。 在safari、chrome上是正确的。
|
|||
// alert('change to portrait')
|
|||
// contentDOM.style.width = height + 'px';
|
|||
// contentDOM.style.height = width + 'px';
|
|||
// contentDOM.style.top = (height - width) / 2 + 'px';
|
|||
// contentDOM.style.left = 0 - (height - width) / 2 + 'px';
|
|||
// //contentDOM.style.transform = 'rotate(90deg)';
|
|||
// }
|
|||
|
|||
// }, false);
|
|||
|
|||
|
|||
|
|||
window.addEventListener('DOMContentLoaded', function(){ |
|||
|
|||
BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function () { |
|||
if (document.getElementById("customLoadingScreenDiv")) { |
|||
// Do not add a loading screen if there is already one
|
|||
document.getElementById("customLoadingScreenDiv").style.display = "initial"; |
|||
return; |
|||
} |
|||
this._loadingDiv = document.createElement("div"); |
|||
this._loadingDiv.id = "customLoadingScreenDiv"; |
|||
//this._loadingDiv.innerHTML = "模型正在加载....";
|
|||
this._loadingDiv.innerHTML = "<image src='./loading.gif' />"; |
|||
var customLoadingScreenCss = document.createElement('style'); |
|||
customLoadingScreenCss.type = 'text/css'; |
|||
customLoadingScreenCss.innerHTML = `
|
|||
#customLoadingScreenDiv{ |
|||
background-color: #3D4456cc; |
|||
color: white; |
|||
font-size:50px; |
|||
text-align:center; |
|||
} |
|||
`;
|
|||
document.getElementsByTagName('head')[0].appendChild(customLoadingScreenCss); |
|||
this._resizeLoadingUI(); |
|||
window.addEventListener("resize", this._resizeLoadingUI); |
|||
document.body.appendChild(this._loadingDiv); |
|||
}; |
|||
|
|||
BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function(){ |
|||
document.getElementById("customLoadingScreenDiv").style.display = "none"; |
|||
console.log("scene is now loaded"); |
|||
} |
|||
function sleep(beginTime,endTime) { |
|||
|
|||
var exitTime = beginTime + 3000; |
|||
while (true) { |
|||
now = new Date(); |
|||
if (now.getTime() > exitTime) |
|||
return; |
|||
} |
|||
} |
|||
|
|||
|
|||
// get the canvas DOM element
|
|||
var canvas = document.getElementById('renderCanvas'); |
|||
|
|||
|
|||
var d = new Date(); |
|||
var n_Begin= d.getTime(); |
|||
console.log("n_Begin:"+n_Begin); |
|||
|
|||
// load the 3D engine
|
|||
var engine = new BABYLON.Engine(canvas, true); |
|||
|
|||
// createScene function that creates and return the scene
|
|||
var createScene = function(){ |
|||
|
|||
engine.displayLoadingUI(); |
|||
// create a basic BJS Scene object
|
|||
var scene = new BABYLON.Scene(engine); |
|||
|
|||
//scene.debugLayer.show();
|
|||
|
|||
|
|||
|
|||
|
|||
var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 5, new BABYLON.Vector3(0, 0, 0), scene); |
|||
console.log(camera); |
|||
// camera.transforms.alpha = 85;
|
|||
//camea.transforms.beta=95;
|
|||
// target the camera to scene origin
|
|||
camera.setTarget(BABYLON.Vector3.Zero()); |
|||
//camera.setPosition(new BABYLON.Vector3(20, 200, 400));
|
|||
// attach the camera to the canvas
|
|||
camera.attachControl(canvas, true); |
|||
|
|||
|
|||
|
|||
camera.lowerRadiusLimit = 2.5 ;// 这里是最大的位置,值越大,物体越小
|
|||
camera.upperRadiusLimit = 20 ; |
|||
camera.Radius = 2.5; |
|||
camera.alpha = 1.5; |
|||
camera.beta = 1; |
|||
camera.inertia=0.1; // 缩放的快慢
|
|||
//scene.VRHelper = scene.createDefaultVRExperience({createDeviceOrientationCamera: false});
|
|||
//var VRHelper = scene.createDefaultVRExperience();
|
|||
//console.log(VRHelper);
|
|||
//VRHelper.onExitingVR.add(()=>{
|
|||
// scene.setActiveCameraByName("Camera");
|
|||
// console.log("abc");
|
|||
//console.log(scene);
|
|||
//})
|
|||
|
|||
|
|||
//scene.setActiveCameraByName("Camera");
|
|||
//console.log(VRHelper);
|
|||
|
|||
// create a basic light, aiming 0,1,0 - meaning, to the sky
|
|||
var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0,1,0), scene); |
|||
|
|||
|
|||
// Skybox
|
|||
var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", {size:1000.0}, scene); |
|||
var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); |
|||
skyboxMaterial.backFaceCulling = false; |
|||
skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene); |
|||
skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; |
|||
skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); |
|||
skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); |
|||
skybox.material = skyboxMaterial; |
|||
|
|||
|
|||
var myColor = BABYLON.Color3.Blue(); |
|||
var line03_position = BABYLON.Vector3(0,0,0); |
|||
var line01_position = BABYLON.Vector3(0,0,0); |
|||
var line17_position = BABYLON.Vector3(0,0,0); |
|||
var line26_position = BABYLON.Vector3(0,0,0); |
|||
|
|||
|
|||
console.log("position:"+line03_position); |
|||
// Initialize GizmoManager
|
|||
var gizmoManager = new BABYLON.GizmoManager(scene) |
|||
BABYLON.SceneLoader.Append("./asset/", "abc2.gltf", scene, function (scene) { |
|||
|
|||
//坐场
|
|||
line03 = scene.getMeshByName("Line03"); |
|||
line03_position = line03.position; |
|||
|
|||
Line03Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Line03Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4,0.4); |
|||
Line03Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line03Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
|
|||
line03.material = Line03Mat; |
|||
|
|||
//左护版
|
|||
line01 = scene.getMeshByName("Line01"); |
|||
line01_position = line01.position; |
|||
Line01Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Line01Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line01Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line01Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
line01.material = Line01Mat; |
|||
|
|||
//左护版
|
|||
//line05 = scene.getMeshByName("Line05");
|
|||
|
|||
//Line05Mat = new BABYLON.StandardMaterial("ground", scene);
|
|||
//Line05Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
|
|||
//Line05Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
|
|||
//Line05Mat.emissiveColor = BABYLON.Color3.Blue();
|
|||
//line05.material = Line05Mat;
|
|||
|
|||
|
|||
//右腿
|
|||
line17 = scene.getMeshByName("Line17"); |
|||
line17_position = line17.position; |
|||
Line17Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Line17Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line17Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line17Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
line17.material = Line17Mat; |
|||
|
|||
//line17.position.x =1;
|
|||
|
|||
//右腿
|
|||
line26 = scene.getMeshByName("Cylinder56"); |
|||
line26_position = line26.position; |
|||
Line26Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Line26Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line26Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Line26Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
line26.material = Line26Mat; |
|||
|
|||
//枪
|
|||
tube15 = scene.getMeshByName("Tube15"); |
|||
tube15_position = tube15.position; |
|||
Tube15Mat = new BABYLON.StandardMaterial("ground", scene); |
|||
Tube15Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Tube15Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); |
|||
Tube15Mat.emissiveColor = BABYLON.Color3.Blue(); |
|||
tube15.material = Tube15Mat; |
|||
|
|||
root = scene.getMeshByName("__root__"); |
|||
|
|||
//console.log("abccc");
|
|||
//console.log(scene);
|
|||
//root.addRotation(0.01, 0, 0);
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
//gizmoManager.boundingBoxGizmoEnabled=true
|
|||
// Restrict gizmos to only spheres
|
|||
gizmoManager.attachableMeshes =[line03,line01,tube15,line26,line17]; |
|||
// Toggle gizmos with keyboard buttons
|
|||
document.onkeydown = (e)=>{ |
|||
if(e.key == 'w'){ |
|||
gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled |
|||
} |
|||
if(e.key == 'e'){ |
|||
gizmoManager.rotationGizmoEnabled = !gizmoManager.rotationGizmoEnabled |
|||
} |
|||
if(e.key == 'r'){ |
|||
gizmoManager.scaleGizmoEnabled = !gizmoManager.scaleGizmoEnabled |
|||
} |
|||
if(e.key == 'q'){ |
|||
gizmoManager.boundingBoxGizmoEnabled = !gizmoManager.boundingBoxGizmoEnabled |
|||
} |
|||
} |
|||
var oldMeth = null; |
|||
// On pick interpolations
|
|||
var prepareButton = function (mesh, color,strss) { |
|||
//var goToColorAction = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", color, 1000, null, true);
|
|||
|
|||
mesh.actionManager = new BABYLON.ActionManager(scene); |
|||
|
|||
// mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor));
|
|||
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Red())); |
|||
// mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Yellow()));
|
|||
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(0.38, 0.38, 0.38), 100)); |
|||
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(0.4, 0.4, 0.4), 100)); |
|||
//mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "wireframe", true))
|
|||
mesh.actionManager.registerAction( |
|||
new BABYLON.ExecuteCodeAction( |
|||
{ |
|||
trigger:BABYLON.ActionManager.OnPickTrigger, |
|||
parameter:"" |
|||
}, |
|||
function(){ |
|||
document.getElementById("show").innerHTML=strss; |
|||
console.log(oldMeth); |
|||
console.log(mesh); |
|||
if(oldMeth != null && oldMeth.id != mesh.id){ |
|||
oldMeth.material.emissiveColor= myColor; |
|||
} |
|||
oldMeth = mesh; |
|||
// mesh.material.emissiveColor= BABYLON.Color3.Red()
|
|||
//mesh.material.emissiveColor = myColor;
|
|||
//console.log(mesh.material.emissiveColor);
|
|||
//mesh.material = BABYLON.Color3.Yellow()
|
|||
//a.innerHTML ="这里是坐长的位置,可以坐人的."
|
|||
} |
|||
) |
|||
); |
|||
} |
|||
var prepareButton2 = function (mesh, color,strss) { |
|||
//var goToColorAction = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", color, 1000, null, true);
|
|||
|
|||
mesh.actionManager = new BABYLON.ActionManager(scene); |
|||
|
|||
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor)); |
|||
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Red())); |
|||
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(1,1, 1), 100)); |
|||
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(1, 1, 1), 100)); |
|||
|
|||
mesh.actionManager.registerAction( |
|||
new BABYLON.ExecuteCodeAction( |
|||
{ |
|||
trigger:BABYLON.ActionManager.OnPickTrigger, |
|||
parameter:"" |
|||
}, |
|||
function(){ |
|||
document.getElementById("show").innerHTML=strss; |
|||
//a.innerHTML ="这里是坐长的位置,可以坐人的."
|
|||
} |
|||
) |
|||
); |
|||
} |
|||
|
|||
prepareButton(line03, BABYLON.Color3.Blue(),`<font size="20">坐舱:</font></br> 又叫驾驶舱(Cockpit)是操作员控制机器人的座舱,通常位于前端。除了早期的,如今大部分机器人的驾驶舱采用密闭式的设计。机器人驾驶舱内一般安装有各类控制系统。 驾驶舱是机器人的首脑元件,为太空船里下令及控制的中心。它是设计用来尽量让驾驶员感到操控舒适,并包含所有先进导航及各项操控的系统,就如同其他提供居住人员所有必需品的组件是一样重要的。</h2>`); |
|||
prepareButton(line01, BABYLON.Color3.Blue(),`<font size="20">铠甲:</font><br> 机械外骨骼或称动力外骨骼(Powered exoskeleton),是一种由钢铁的框架构成并且可让人穿上的机器装置,这个装备可以提供额外能量来供四肢运动。别称:强化服、动力服(Power Suit)、动力装甲(Power armor或Powered armor)、Exoframe、Hardsuit或Exosuit等。凭借这套“服装”,人类就可以成为所谓的“铁人”。
|
|||
<br/><br/> 动力外骨骼更倾向于军用,除了能够增强人体能力的这一基本功能外,还要具有良好的防护性、对复杂环境的适应性以及辅助火力、通信、侦查支持等军用功能。 |
|||
<br/><br/> 动力服是设计成用来保护穿戴者的,例如为了保护士兵或建筑工而设计,或设计用来进行救援身处险境的人员上。广泛一些的用途则是用来做为义肢与帮助老弱者行动。其它的用途则是用来进行救援行动,就像在一栋要倒塌的建筑物里,这个装置可以提供给工人很大的力量来举起重物,同时保护它不被落下的碎石砸伤。在日本,有银行为需常搬运沉重钞票及硬币的员工配备外骨骼,以降低身体负担。`);
|
|||
//prepareButton(line05, BABYLON.Color3.Blue(),"右护版");
|
|||
prepareButton(line17, BABYLON.Color3.Blue(),`<font size="20">左脚:</font>
|
|||
<br><br> 用激光器作为辐射源的雷达。激光雷达是激光技术与雷达技术相结合的产物 。由发射机 、天线 、接收机 、跟踪架及信息处理等部分组成。发射机是各种形式的激光器,如二氧化碳激光器、掺钕钇铝石榴石激光器、半导体激光器及波长可调谐的固体激光器等;天线是光学望远镜;接收机采用各种形式的光电探测器,如光电倍增管、半导体光电二极管、雪崩光电二极管、红外和可见光多元探测器件等。激光雷达采用脉冲或连续波2种工作方式,探测方法分直接探测与外差探测。 |
|||
<br><img src='./img/2.jpg' height='400'>`);
|
|||
prepareButton(line26, BABYLON.Color3.Blue(),`<font size="20">机器关节:</font><br/><br/> 机器人关节驱动器是一种集电液伺服阀及摆动缸于一体的液压或气动装置。关节机器人常见的有协作机器人(六轴、七轴)、外骨骼机器人、四足、双足、手术机器人等,里面用的东西基本都包含力矩电机、编码器、减速器、驱动器等,有的可能会用到抱闸、力矩传感器。但是每个应用匹配的方案不一样,用的产品也是多种多样。<br/><img src='./img/4.jpg'>`); |
|||
prepareButton(tube15, BABYLON.Color3.Blue(),`<p class='p13'><font size="20">机枪:</font><br/><br/> 机枪(Machine gun) 一种带有枪架或枪座,能实现连发射击的自动枪械。世界第一挺机枪是个叫伐商的比利时工程师(曾是拿破伦手下的上尉)于1851年设计的。该枪曾在1870、1871年的普法战争中用过。而普遍观点认为,现代机枪的鼻祖是加特林多管式机枪。1862年,由美国人理查德·杰丹·加特林发明,这种枪有几个枪筒,可以轮转。1883年,美国人海尔曼·S·马克沁进行革新,机枪变为单枪筒,利用后坐力,使上膛、射击和退弹能同时完成,枪身用枪筒上的水套降温,每分钟可射击650次,名为马克沁机枪.<br/></p><video src='a.mp4' controls='controls'></video> `); |
|||
|
|||
var d1 = new Date(); |
|||
var n_end= d1.getTime(); |
|||
console.log("n_end:"+n_end); |
|||
console.log(n_end - n_Begin); |
|||
|
|||
sleep(n_Begin,n_end); |
|||
|
|||
engine.hideLoadingUI(); |
|||
|
|||
}); |
|||
|
|||
|
|||
|
|||
//GUI
|
|||
|
|||
// Another GUI on the right
|
|||
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI"); |
|||
advancedTexture.layer.layerMask = 2; |
|||
|
|||
var panel3 = new BABYLON.GUI.StackPanel(); |
|||
panel3.width = "800px"; |
|||
panel3.fontSize = "30px"; |
|||
panel3.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
panel3.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; |
|||
advancedTexture.addControl(panel3); |
|||
|
|||
|
|||
var button1 = BABYLON.GUI.Button.CreateSimpleButton("but1", "旋 转"); |
|||
button1.width = 0.2; |
|||
button1.height = "80px"; |
|||
button1.color = "white"; |
|||
button1.cornerRadius = 20; |
|||
button1.background = "green"; |
|||
button1.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
//button1.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
|
|||
|
|||
//button1.centerY=5;
|
|||
//console.log(button1);
|
|||
//button1.position.x = 300;
|
|||
//button1.position.y = 5;
|
|||
|
|||
|
|||
var aaab = false; |
|||
button1.onPointerUpObservable.add(function() { |
|||
// circle.scaleX += 0.1;
|
|||
if(aaab== false){ |
|||
scene.registerBeforeRender(function(){ |
|||
root.addRotation(0.00, 0.008, 0); |
|||
button1.textBlock.text = "停 止"; |
|||
aaab = true; |
|||
button1.background = "red"; |
|||
}); |
|||
}else{ |
|||
scene.registerBeforeRender(function(){ |
|||
root.addRotation(0.00, -0.008, 0); |
|||
button1.textBlock.text = "旋 转"; |
|||
aaab = false; |
|||
button1.background = "green"; |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
|
|||
|
|||
var button3 = BABYLON.GUI.Button.CreateSimpleButton("but2", "展 开"); |
|||
button3.width = 0.2; |
|||
button3.height = "80px"; |
|||
button3.color = "white"; |
|||
button3.cornerRadius = 20; |
|||
button3.background = "green"; |
|||
var bob = false; |
|||
button3.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
button3.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; |
|||
|
|||
|
|||
|
|||
button3.onPointerUpObservable.add(function() { |
|||
// circle.scaleX += 0.1;
|
|||
//gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled
|
|||
if(bob== false){ |
|||
bob = true; |
|||
button3.textBlock.text = "合 体"; |
|||
|
|||
button3.background = "red"; |
|||
|
|||
var animationBox = new BABYLON.Animation("tutoAnimation", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys = []; |
|||
|
|||
keys.push({ |
|||
frame: 0, |
|||
value: line03_position |
|||
}); |
|||
|
|||
keys.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(line03_position.x+60,line03_position.y,line03_position.z) |
|||
}); |
|||
|
|||
animationBox.setKeys(keys); |
|||
|
|||
line03.animations.push(animationBox); //中间坐舱
|
|||
//scene.beginAnimation(line03, 0, 100, false);
|
|||
|
|||
//左护版
|
|||
var animationBox2 = new BABYLON.Animation("Animation2", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys1 = []; |
|||
|
|||
keys1.push({ |
|||
frame: 0, |
|||
value: line01_position |
|||
}); |
|||
|
|||
keys1.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(line01_position.x-40,line01_position.y,line01_position.z) |
|||
}); |
|||
|
|||
animationBox2.setKeys(keys1); |
|||
|
|||
line01.animations.push(animationBox2); //中间坐舱
|
|||
//scene.beginAnimation(line01, 0, 100, true);
|
|||
|
|||
|
|||
//左脚
|
|||
var animationBox3 = new BABYLON.Animation("animationBox3", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys2 = []; |
|||
|
|||
keys2.push({ |
|||
frame: 0, |
|||
value: line17_position |
|||
}); |
|||
|
|||
keys2.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(line17_position.x-50,line17_position.y,line17_position.z) |
|||
}); |
|||
|
|||
animationBox3.setKeys(keys2); |
|||
|
|||
line17.animations.push(animationBox3); //中间坐舱
|
|||
//scene.beginAnimation(line17, 0, 100, true);
|
|||
|
|||
//右脚
|
|||
var animationBox4 = new BABYLON.Animation("animationBox4", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys4 = []; |
|||
|
|||
keys4.push({ |
|||
frame: 0, |
|||
value: line26_position |
|||
}); |
|||
|
|||
keys4.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(line26_position.x+50,line26_position.y,line26_position.z) |
|||
}); |
|||
|
|||
animationBox4.setKeys(keys4); |
|||
|
|||
line26.animations.push(animationBox4); //中间坐舱
|
|||
//scene.beginAnimation(line26, 0, 100, true);
|
|||
|
|||
|
|||
//枪
|
|||
var animationBox5 = new BABYLON.Animation("animationBox5", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys5 = []; |
|||
|
|||
keys5.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(-23,0,-47.5) |
|||
}); |
|||
|
|||
keys5.push({ |
|||
frame: 20, |
|||
value:new BABYLON.Vector3(-2,0,-90) |
|||
}); |
|||
|
|||
animationBox5.setKeys(keys5); |
|||
|
|||
tube15.animations.push(animationBox5); //中间坐舱
|
|||
//scene.beginAnimation(tube15, 0, 100, true);
|
|||
|
|||
|
|||
|
|||
setTimeout(async () => { |
|||
var anim1 = scene.beginAnimation(line01, 0, 100, false); |
|||
var anim2 = scene.beginAnimation(line03, 0, 100, false); |
|||
var anim3 = scene.beginAnimation(line17, 0, 100, false); |
|||
var anim4 = scene.beginAnimation(line26, 0, 100, false); |
|||
var anim5 = scene.beginAnimation(tube15, 0, 100, false); |
|||
console.log("ddd"); |
|||
//await anim1.waitAsync();
|
|||
//await anim2.waitAsync();
|
|||
//await anim3.waitAsync();
|
|||
//await anim4.waitAsync();
|
|||
await anim5.waitAsync(); |
|||
console.log("dd33d"); |
|||
scene.stopAnimation(line01); |
|||
scene.stopAnimation(line03); |
|||
scene.stopAnimation(line17); |
|||
scene.stopAnimation(line26); |
|||
scene.stopAnimation(tube15); |
|||
}); |
|||
|
|||
|
|||
}else{ |
|||
bob = false; |
|||
button3.background = "green"; |
|||
var animationBox = new BABYLON.Animation("tutoAnimation", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys = []; |
|||
|
|||
keys.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(line03_position.x-60,line03_position.y,line03_position.z) |
|||
}); |
|||
|
|||
keys.push({ |
|||
frame: 20, |
|||
value: line03_position |
|||
}); |
|||
|
|||
animationBox.setKeys(keys); |
|||
|
|||
line03.animations.push(animationBox); //中间坐舱
|
|||
//scene.beginAnimation(line03, 0, 100, true);
|
|||
|
|||
//左护版
|
|||
var animationBox2 = new BABYLON.Animation("Animation2", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys1 = []; |
|||
|
|||
keys1.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(line01_position.x+40,line01_position.y,line01_position.z) |
|||
}); |
|||
|
|||
keys1.push({ |
|||
frame: 20, |
|||
value:line01_position |
|||
}); |
|||
|
|||
animationBox2.setKeys(keys1); |
|||
|
|||
line01.animations.push(animationBox2); //中间坐舱
|
|||
//scene.beginAnimation(line01, 0, 100, true);
|
|||
|
|||
|
|||
//左脚
|
|||
var animationBox3 = new BABYLON.Animation("animationBox3", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys2 = []; |
|||
|
|||
keys2.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(line17_position.x+50,line17_position.y,line17_position.z) |
|||
}); |
|||
|
|||
keys2.push({ |
|||
frame: 20, |
|||
value:line17_position |
|||
}); |
|||
|
|||
animationBox3.setKeys(keys2); |
|||
|
|||
line17.animations.push(animationBox3); //中间坐舱
|
|||
// scene.beginAnimation(line17, 0, 100, true);
|
|||
|
|||
//右脚
|
|||
var animationBox4 = new BABYLON.Animation("animationBox4", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys4 = []; |
|||
|
|||
keys4.push({ |
|||
frame: 0, |
|||
value: new BABYLON.Vector3(line26_position.x-50,line26_position.y,line26_position.z) |
|||
}); |
|||
|
|||
keys4.push({ |
|||
frame: 20, |
|||
value: line26_position |
|||
}); |
|||
|
|||
animationBox4.setKeys(keys4); |
|||
|
|||
line26.animations.push(animationBox4); //中间坐舱
|
|||
//scene.beginAnimation(line26, 0, 100, true);
|
|||
|
|||
//枪
|
|||
var animationBox5 = new BABYLON.Animation("animationBox5", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, |
|||
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); |
|||
// Animation keys
|
|||
var keys5 = []; |
|||
|
|||
keys5.push({ |
|||
frame: 0, |
|||
value:new BABYLON.Vector3(-2,0,-90) |
|||
|
|||
}); |
|||
|
|||
keys5.push({ |
|||
frame: 20, |
|||
value: new BABYLON.Vector3(-23,0,-47.5) |
|||
}); |
|||
|
|||
animationBox5.setKeys(keys5); |
|||
|
|||
tube15.animations.push(animationBox5); //中间坐舱
|
|||
|
|||
button3.textBlock.text = "展 开"; |
|||
|
|||
setTimeout(async () => { |
|||
var anim1 = scene.beginAnimation(line01, 0, 100, false); |
|||
var anim2 = scene.beginAnimation(line03, 0, 100, false); |
|||
var anim3 = scene.beginAnimation(line17, 0, 100, false); |
|||
var anim4 = scene.beginAnimation(line26, 0, 100, false); |
|||
var anim5 = scene.beginAnimation(tube15, 0, 100, false); |
|||
console.log("ddd"); |
|||
await anim1.waitAsync(); |
|||
await anim2.waitAsync(); |
|||
await anim3.waitAsync(); |
|||
await anim4.waitAsync(); |
|||
await anim5.waitAsync(); |
|||
console.log("dd33d"); |
|||
scene.stopAnimation(line01); |
|||
scene.stopAnimation(line03); |
|||
scene.stopAnimation(line17); |
|||
scene.stopAnimation(line26); |
|||
scene.stopAnimation(tube15); |
|||
}); |
|||
|
|||
|
|||
} |
|||
}); |
|||
|
|||
var button2 = BABYLON.GUI.Button.CreateSimpleButton("but2", "拆 解"); |
|||
button2.width =0.2; |
|||
button2.height = "80px"; |
|||
button2.color = "white"; |
|||
button2.cornerRadius = 20; |
|||
button2.background = "green"; |
|||
|
|||
button2.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
button2.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; |
|||
|
|||
var selectOne = false; |
|||
|
|||
button2.onPointerUpObservable.add(function() { |
|||
// circle.scaleX += 0.1;
|
|||
gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled |
|||
if(selectOne== false){ |
|||
//scene.stopAnimation(line01);
|
|||
//scene.stopAnimation(line03);
|
|||
//scene.stopAnimation(line17);
|
|||
//scene.stopAnimation(line26);
|
|||
//scene.stopAnimation(tube15);
|
|||
|
|||
selectOne = true; |
|||
button2.background = "red"; |
|||
button2.textBlock.text = "取 消"; |
|||
}else{ |
|||
//window.location.reload(true);
|
|||
|
|||
selectOne = false; |
|||
button2.background = "green"; |
|||
button2.textBlock.text = "拆 解"; |
|||
} |
|||
}); |
|||
|
|||
var button4 = BABYLON.GUI.Button.CreateSimpleButton("but4", "还 原"); |
|||
//button4.fontSize = "26px";
|
|||
button4.width = 0.2; |
|||
button4.height = "80px"; |
|||
button4.color = "white"; |
|||
button4.cornerRadius = 20; |
|||
button4.background = "green"; |
|||
button4.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT; |
|||
button4.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; |
|||
button4.onPointerUpObservable.add(function() { |
|||
window.location.reload(true); |
|||
}); |
|||
|
|||
|
|||
panel3.addControl(button1); |
|||
|
|||
panel3.addControl(button3); |
|||
panel3.addControl(button2); |
|||
panel3.addControl(button4); |
|||
return scene; |
|||
} |
|||
|
|||
// call the createScene function
|
|||
var scene = createScene(); |
|||
//var a = scene.getElementById("__root");
|
|||
// run the render loop
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/**/ |
|||
|
|||
engine.runRenderLoop(function(){ |
|||
scene.render(); |
|||
}); |
|||
var abc1 = scene.getMeshByName("plane"); |
|||
|
|||
window.addEventListener('resize', function(){ |
|||
engine.resize(); |
|||
}); |
|||
}); |
18706
public/webWater/js/jquery-ui.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
11008
public/webWater/js/jquery.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,138 +0,0 @@ |
|||
/** |
|||
* jQuery.timers - Timer abstractions for jQuery |
|||
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) |
|||
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
|
|||
* Date: 2009/10/16 |
|||
* |
|||
* @author Blair Mitchelmore |
|||
* @version 1.2 |
|||
* |
|||
**/ |
|||
|
|||
jQuery.fn.extend({ |
|||
everyTime: function(interval, label, fn, times) { |
|||
return this.each(function() { |
|||
jQuery.timer.add(this, interval, label, fn, times); |
|||
}); |
|||
}, |
|||
oneTime: function(interval, label, fn) { |
|||
return this.each(function() { |
|||
jQuery.timer.add(this, interval, label, fn, 1); |
|||
}); |
|||
}, |
|||
stopTime: function(label, fn) { |
|||
return this.each(function() { |
|||
jQuery.timer.remove(this, label, fn); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
jQuery.extend({ |
|||
timer: { |
|||
global: [], |
|||
guid: 1, |
|||
dataKey: "jQuery.timer", |
|||
regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, |
|||
powers: { |
|||
// Yeah this is major overkill...
|
|||
'ms': 1, |
|||
'cs': 10, |
|||
'ds': 100, |
|||
's': 1000, |
|||
'das': 10000, |
|||
'hs': 100000, |
|||
'ks': 1000000 |
|||
}, |
|||
timeParse: function(value) { |
|||
if (value == undefined || value == null) |
|||
return null; |
|||
var result = this.regex.exec(jQuery.trim(value.toString())); |
|||
if (result[2]) { |
|||
var num = parseFloat(result[1]); |
|||
var mult = this.powers[result[2]] || 1; |
|||
return num * mult; |
|||
} else { |
|||
return value; |
|||
} |
|||
}, |
|||
add: function(element, interval, label, fn, times) { |
|||
var counter = 0; |
|||
|
|||
if (jQuery.isFunction(label)) { |
|||
if (!times) |
|||
times = fn; |
|||
fn = label; |
|||
label = interval; |
|||
} |
|||
|
|||
interval = jQuery.timer.timeParse(interval); |
|||
|
|||
if (typeof interval != 'number' || isNaN(interval) || interval < 0) |
|||
return; |
|||
|
|||
if (typeof times != 'number' || isNaN(times) || times < 0) |
|||
times = 0; |
|||
|
|||
times = times || 0; |
|||
|
|||
var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {}); |
|||
|
|||
if (!timers[label]) |
|||
timers[label] = {}; |
|||
|
|||
fn.timerID = fn.timerID || this.guid++; |
|||
|
|||
var handler = function() { |
|||
if ((++counter > times && times !== 0) || fn.call(element, counter) === false) |
|||
jQuery.timer.remove(element, label, fn); |
|||
}; |
|||
|
|||
handler.timerID = fn.timerID; |
|||
|
|||
if (!timers[label][fn.timerID]) |
|||
timers[label][fn.timerID] = window.setInterval(handler,interval); |
|||
|
|||
this.global.push( element ); |
|||
|
|||
}, |
|||
remove: function(element, label, fn) { |
|||
var timers = jQuery.data(element, this.dataKey), ret; |
|||
|
|||
if ( timers ) { |
|||
|
|||
if (!label) { |
|||
for ( label in timers ) |
|||
this.remove(element, label, fn); |
|||
} else if ( timers[label] ) { |
|||
if ( fn ) { |
|||
if ( fn.timerID ) { |
|||
window.clearInterval(timers[label][fn.timerID]); |
|||
delete timers[label][fn.timerID]; |
|||
} |
|||
} else { |
|||
for ( var fn in timers[label] ) { |
|||
window.clearInterval(timers[label][fn]); |
|||
delete timers[label][fn]; |
|||
} |
|||
} |
|||
|
|||
for ( ret in timers[label] ) break; |
|||
if ( !ret ) { |
|||
ret = null; |
|||
delete timers[label]; |
|||
} |
|||
} |
|||
|
|||
for ( ret in timers ) break; |
|||
if ( !ret ) |
|||
jQuery.removeData(element, this.dataKey); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
jQuery(window).bind("unload", function() { |
|||
jQuery.each(jQuery.timer.global, function(index, item) { |
|||
jQuery.timer.remove(item); |
|||
}); |
|||
}); |
@ -0,0 +1,11 @@ |
|||
<svg t="1745560639747" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1507" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"> |
|||
<defs> |
|||
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="0%"> |
|||
<stop offset="0" style="stop-color:#C8E4FF"/> |
|||
<stop offset="0.632" style="stop-color:#339CFF"/> |
|||
<stop offset="1" style="stop-color:#339CFF"/> |
|||
</linearGradient> |
|||
</defs> |
|||
<path d="M336 804.8v-91.2l176 123.2L336 960v-89.6C172 826.4 57.6 724 57.6 600.8c0-56.8 24.8-110.4 69.6-156.8 12-12.8 32-13.6 44.8-0.8 12.8 12 13.6 32 0.8 44.8l-0.8 0.8c-33.6 34.4-51.2 72.8-51.2 112 0 85.6 85.6 164.8 215.2 204z m280 80c-17.6 3.2-33.6-8.8-36.8-25.6-3.2-17.6 8.8-33.6 25.6-36.8 0.8 0 0.8 0 2.4-0.8C781.6 795.2 904 701.6 904 600c0-37.6-16-74.4-47.2-108-12-12.8-11.2-32.8 1.6-44.8 12.8-12 32.8-11.2 44.8 1.6C944.8 493.6 968 545.6 968 600c-0.8 140.8-149.6 255.2-352 284.8zM512 678.4L265.6 528.8v-300L512 79.2l247.2 149.6v300L512 678.4z m188.8-180V307.2L540.8 408v192l160-101.6z m-377.6 0l160 101.6V398.4l-160-99.2v199.2zM512 139.2L346.4 244 516 348.8h6.4l160.8-101.6-171.2-108z" fill="url(#gradient)" p-id="1508"></path> |
|||
</svg> |
|||
|
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" standalone="no"?> |
|||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
|||
<svg t="1745560614938" class="icon" viewBox="0 0 1048 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1514" xmlns:xlink="http://www.w3.org/1999/xlink" width="204.6875" height="200"> |
|||
<!-- 定义线性渐变 --> |
|||
<linearGradient id="myGradient" x1="0%" y1="0%" x2="100%" y2="0%"> |
|||
<stop offset="0" style="stop-color:#C8E4FF"/> |
|||
<stop offset="0.632" style="stop-color:#339CFF"/> |
|||
<stop offset="1" style="stop-color:#339CFF"/> |
|||
</linearGradient> |
|||
<path d="M962.33522 593.895024c0-44.956098-20.979512-86.915122-56.944391-125.877073-14.985366-14.985366-11.988293-35.964878 0-50.950244 14.985366-14.985366 35.964878-11.988293 50.950244 0 50.950244 50.950244 77.923902 113.88878 77.923903 176.827317 0 137.865366-128.874146 254.75122-314.692683 305.701464v101.900488l-200.803903-140.862439 200.803903-140.862439v101.900487c143.859512-41.959024 242.762927-131.87122 242.762927-227.777561z m-836.183415-176.827317c14.985366 14.985366 14.985366 35.964878 2.997073 50.950244-35.964878 38.961951-53.947317 80.920976-53.947317 122.88 0 116.885854 137.865366 221.783415 335.672195 251.754147h2.997073c20.979512 2.997073 32.967805 20.979512 29.970732 41.959024-2.997073 20.979512-20.979512 32.967805-41.959024 29.970732-230.774634-32.967805-398.610732-164.839024-401.607805-323.683903 0-62.938537 26.973659-119.882927 74.926829-170.833171 14.985366-14.985366 35.964878-14.985366 50.950244-2.997073z m110.891707-174.979122l68.932683 43.082927v188.81561c-2.997073 2.997073 179.82439 116.885854 179.82439 116.885854v-193.336196l65.93561 41.209757v149.154341l118.534244-75.076683 60.690732 37.937951-212.192781 130.048-281.724878-170.83317V242.088585zM157.396293 74.52722l698.967414 436.773463a37.463415 37.463415 0 0 1-39.711219 63.537951L117.685073 138.065171a37.463415 37.463415 0 1 1 39.71122-63.537951zM518.793366 0.499512l278.727805 170.833171v273.732683l-65.93561-41.209756V249.256585l-124.578341 76.8-63.013464-39.386536 160.593171-100.352-188.81561-119.882927c2.197854 2.197854-101.800585 68.757854-157.546146 104.148293l-59.092293-36.913952L518.76839 0.474537z" |
|||
fill="url(#myGradient)" p-id="1515"> |
|||
</path> |
|||
</svg> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue