Browse Source

3D库房样式更换

master
xuhuajiao 3 years ago
parent
commit
96abde141b
  1. 105
      public/webA/index.js
  2. 120
      public/webB/index.js
  3. 104
      public/webC/index.js
  4. 179
      public/webTotal/index.js

105
public/webA/index.js

@ -663,44 +663,43 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
x.overlayColor = BABYLON.Color3.White(); x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true; x.renderOverlay = true;
x = scene.getMeshByName("墙体");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("墙体");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
//修改贴图
var bluexMat = new BABYLON.PBRMaterial("bluex", scene);
var tempddxa = new BABYLON.Texture("./asset/blue.png", scene);
var tempddxb = new BABYLON.Texture("./asset/blue.png", scene);
tempddxa.hasAlpha = true;
tempddxa.hasAlpha = true;
tempddxa.uAng = (180 * Math.PI) / 180;
tempddxb.uAng = (180 * Math.PI) / 180;
bluexMat.useAlphaFromAlbedoTexture = true;
bluexMat.albedoTexture = tempddxa;
bluexMat.reflectionColor = new BABYLON.Color3(0, 0, 0);
bluexMat.lightmapTexture = tempddxb;
scene.getMeshByName("平面_1").material = bluexMat;
var redMat = new BABYLON.PBRMaterial("redMat", scene);
var tempddx2 = new BABYLON.Texture("./asset/red.png", scene);
var tempddx3 = new BABYLON.Texture("./asset/red.png", scene);
tempddx2.hasAlpha = true;
tempddx3.hasAlpha = true;
tempddx2.uAng = (180 * Math.PI) / 180;
tempddx3.uAng = (180 * Math.PI) / 180;
//修改贴图
var bluexMat = new BABYLON.PBRMaterial("bluex", scene);
var tempddxa = new BABYLON.Texture("./asset/blue.png", scene);
var tempddxb = new BABYLON.Texture("./asset/blue.png", scene);
tempddxa.hasAlpha = true;
tempddxa.hasAlpha = true;
tempddxa.uAng = 180 * Math.PI / 180;
tempddxb.uAng = 180 * Math.PI / 180;
bluexMat.useAlphaFromAlbedoTexture = true;
bluexMat.albedoTexture =tempddxa;
bluexMat.reflectionColor = new BABYLON.Color3(0,0,0);
bluexMat.lightmapTexture =tempddxb;
scene.getMeshByName("平面_1").material = bluexMat;
var redMat = new BABYLON.PBRMaterial("redMat", scene);
var tempddx2 = new BABYLON.Texture("./asset/red.png", scene);
var tempddx3 = new BABYLON.Texture("./asset/red.png", scene);
tempddx2.hasAlpha = true;
tempddx3.hasAlpha = true;
tempddx2.uAng = 180 * Math.PI / 180;
tempddx3.uAng = 180 * Math.PI / 180;
redMat.useAlphaFromAlbedoTexture = true;
redMat.reflectionColor = new BABYLON.Color3(0,0,0);
//redMat.emissiveTexture =tempddx2;
redMat.albedoTexture =tempddx2;
redMat.lightmapTexture =tempddx3;
scene.getMeshByName("平面_1_2").material = redMat;
redMat.useAlphaFromAlbedoTexture = true;
redMat.reflectionColor = new BABYLON.Color3(0, 0, 0);
//redMat.emissiveTexture =tempddx2;
redMat.albedoTexture = tempddx2;
redMat.lightmapTexture = tempddx3;
scene.getMeshByName("平面_1_2").material = redMat;
//平面2 //平面2
//Set font //Set font
@ -769,7 +768,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat2 = new BABYLON.StandardMaterial("mat2", scene); var mat2 = new BABYLON.StandardMaterial("mat2", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat2.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat2.emissiveTexture = dynamicTexture2; mat2.emissiveTexture = dynamicTexture2;
// mat2.alpha = 0.75; // mat2.alpha = 0.75;
@ -797,7 +796,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat3 = new BABYLON.StandardMaterial("mat3", scene); var mat3 = new BABYLON.StandardMaterial("mat3", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat3.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat3.emissiveTexture = dynamicTexture3; mat3.emissiveTexture = dynamicTexture3;
// mat3.alpha = 0.75; // mat3.alpha = 0.75;
@ -825,7 +824,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat4 = new BABYLON.StandardMaterial("mat4", scene); var mat4 = new BABYLON.StandardMaterial("mat4", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat4.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat4.emissiveTexture = dynamicTexture4; mat4.emissiveTexture = dynamicTexture4;
// mat4.alpha = 0.75; // mat4.alpha = 0.75;
@ -843,6 +842,29 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
scene.getMeshByName("tapblue").setEnabled(false); scene.getMeshByName("tapblue").setEnabled(false);
scene.getMeshByName("tapred").setEnabled(false); scene.getMeshByName("tapred").setEnabled(false);
var light = new BABYLON.HemisphericLight(
"HemiLight",
new BABYLON.Vector3(0, 1, 0),
scene
);
light.intensity = 2;
light.diffuse = new BABYLON.Color3(0.92, 0.92, 0.92);
var material1 = scene.getMaterialByName("材质.075");
material1.albedoColor = new BABYLON.Color3(160 / 255, 160 / 255, 160 / 255);
material1.roughness = 1;
//地
var material2 = scene.getMaterialByName("材质.074");
material2.metallic = 0.52;
material2.roughness = 0;
//material2.metallicReflectanceColor=new BABYLON.Color3(1,0,0);
material2.albedoColor = new BABYLON.Color3(0.8, 0.8, 0.8);
var material3 = scene.getMaterialByName("材质.084");
material3.emissiveColor = new BABYLON.Color3(0.278, 0.278, 0.278);
material3.metallic = 0.87;
material3.roughness = 0;
}; };
// createScene function that creates and return the scene // createScene function that creates and return the scene
@ -1499,7 +1521,7 @@ var scene = createScene();
scene.autoClear = true; scene.autoClear = true;
scene.imageProcessingConfiguration.exposure = 1; scene.imageProcessingConfiguration.exposure = 1;
scene.imageProcessingConfiguration.contrast = 1; scene.imageProcessingConfiguration.contrast = 1;
scene.environmentIntensity = 1;
scene.environmentIntensity = 0.4;
engine.runRenderLoop(function() { engine.runRenderLoop(function() {
scene.render(); scene.render();
}); });
@ -1665,7 +1687,6 @@ function cabinetClick(cabinet) {
); );
} }
// 摄像头和温湿度点击 // 摄像头和温湿度点击
// function cameraClick(TheCamera) { // function cameraClick(TheCamera) {
// alert(TheCamera.nameID); // alert(TheCamera.nameID);

120
public/webB/index.js

@ -293,38 +293,38 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
x.overlayColor = BABYLON.Color3.White(); x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true; x.renderOverlay = true;
//修改贴图
var bluexMat = new BABYLON.PBRMaterial("bluex", scene);
var tempddxa = new BABYLON.Texture("./asset/blue.png", scene);
var tempddxb = new BABYLON.Texture("./asset/blue.png", scene);
tempddxa.hasAlpha = true;
tempddxa.hasAlpha = true;
tempddxa.uAng = 180 * Math.PI / 180;
tempddxb.uAng = 180 * Math.PI / 180;
bluexMat.useAlphaFromAlbedoTexture = true;
bluexMat.albedoTexture =tempddxa;
bluexMat.reflectionColor = new BABYLON.Color3(0,0,0);
bluexMat.lightmapTexture =tempddxb;
scene.getMeshByName("平面_1").material = bluexMat;
var redMat = new BABYLON.PBRMaterial("redMat", scene);
var tempddx2 = new BABYLON.Texture("./asset/red.png", scene);
var tempddx3 = new BABYLON.Texture("./asset/red.png", scene);
tempddx2.hasAlpha = true;
tempddx3.hasAlpha = true;
tempddx2.uAng = 180 * Math.PI / 180;
tempddx3.uAng = 180 * Math.PI / 180;
redMat.useAlphaFromAlbedoTexture = true;
redMat.reflectionColor = new BABYLON.Color3(0,0,0);
//redMat.emissiveTexture =tempddx2;
redMat.albedoTexture =tempddx2;
redMat.lightmapTexture =tempddx3;
scene.getMeshByName("平面_1_2").material = redMat;
//修改贴图
var bluexMat = new BABYLON.PBRMaterial("bluex", scene);
var tempddxa = new BABYLON.Texture("./asset/blue.png", scene);
var tempddxb = new BABYLON.Texture("./asset/blue.png", scene);
tempddxa.hasAlpha = true;
tempddxa.hasAlpha = true;
tempddxa.uAng = (180 * Math.PI) / 180;
tempddxb.uAng = (180 * Math.PI) / 180;
bluexMat.useAlphaFromAlbedoTexture = true;
bluexMat.albedoTexture = tempddxa;
bluexMat.reflectionColor = new BABYLON.Color3(0, 0, 0);
bluexMat.lightmapTexture = tempddxb;
scene.getMeshByName("平面_1").material = bluexMat;
var redMat = new BABYLON.PBRMaterial("redMat", scene);
var tempddx2 = new BABYLON.Texture("./asset/red.png", scene);
var tempddx3 = new BABYLON.Texture("./asset/red.png", scene);
tempddx2.hasAlpha = true;
tempddx3.hasAlpha = true;
tempddx2.uAng = (180 * Math.PI) / 180;
tempddx3.uAng = (180 * Math.PI) / 180;
redMat.useAlphaFromAlbedoTexture = true;
redMat.reflectionColor = new BABYLON.Color3(0, 0, 0);
//redMat.emissiveTexture =tempddx2;
redMat.albedoTexture = tempddx2;
redMat.lightmapTexture = tempddx3;
scene.getMeshByName("平面_1_2").material = redMat;
var font_size = 48; var font_size = 48;
var font = "bold " + font_size + "px Arial"; var font = "bold " + font_size + "px Arial";
@ -388,7 +388,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat2 = new BABYLON.StandardMaterial("mat2", scene); var mat2 = new BABYLON.StandardMaterial("mat2", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat2.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat2.emissiveTexture = dynamicTexture2; mat2.emissiveTexture = dynamicTexture2;
mat2.reflectivityColor = new BABYLON.Color3(0, 0, 0); mat2.reflectivityColor = new BABYLON.Color3(0, 0, 0);
@ -413,7 +413,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat3 = new BABYLON.StandardMaterial("mat3", scene); var mat3 = new BABYLON.StandardMaterial("mat3", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat3.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat3.emissiveTexture = dynamicTexture3; mat3.emissiveTexture = dynamicTexture3;
mat3.reflectivityColor = new BABYLON.Color3(0, 0, 0); mat3.reflectivityColor = new BABYLON.Color3(0, 0, 0);
@ -438,7 +438,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat4 = new BABYLON.StandardMaterial("mat4", scene); var mat4 = new BABYLON.StandardMaterial("mat4", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat4.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat4.emissiveTexture = dynamicTexture4; mat4.emissiveTexture = dynamicTexture4;
mat4.reflectivityColor = new BABYLON.Color3(0, 0, 0); mat4.reflectivityColor = new BABYLON.Color3(0, 0, 0);
@ -453,6 +453,44 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
scene.getMeshByName("tapblue").setEnabled(false); scene.getMeshByName("tapblue").setEnabled(false);
scene.getMeshByName("tapred").setEnabled(false); scene.getMeshByName("tapred").setEnabled(false);
var plane = BABYLON.MeshBuilder.CreatePlane(
"plane",
{ width: 10, height: 10 },
scene
);
plane.position = new BABYLON.Vector3(0.11, 1.93, -0.81);
plane.rotation = new BABYLON.Vector3((90 * Math.PI) / 180, 0, 0);
plane.scaling = new BABYLON.Vector3(1.2, 1, 1);
var material2d = scene.getMaterialByName("材质.16");
material2d.metallic = 0.52;
material2d.roughness = 0;
//material2.metallicReflectanceColor=new BABYLON.Color3(1,0,0);
material2d.albedoColor = new BABYLON.Color3(0.8, 0.8, 0.8);
scene.getMaterialByName("Desk.010").metallic = 0.8;
scene.getMaterialByName("Desk.010").roughness = 0.72;
scene.getMaterialByName("Desk.011").metallic = 0.8;
scene.getMaterialByName("Desk.011").roughness = 0.72;
scene.getMaterialByName("Desk.012").metallic = 0.8;
scene.getMaterialByName("Desk.012").roughness = 0.72;
scene.getMaterialByName("Desk.013").metallic = 0.8;
scene.getMaterialByName("Desk.013").roughness = 0.72;
scene.getMaterialByName("Desk.014").metallic = 0.8;
scene.getMaterialByName("Desk.014").roughness = 0.72;
scene.getMaterialByName("Desk.015").metallic = 0.8;
scene.getMaterialByName("Desk.015").roughness = 0.72;
scene.getMaterialByName("Desk.016").metallic = 0.8;
scene.getMaterialByName("Desk.016").roughness = 0.72;
scene.getMaterialByName("Desk.017").metallic = 0.8;
scene.getMaterialByName("Desk.017").roughness = 0.72;
scene.getMaterialByName("Desk.018").metallic = 0.8;
scene.getMaterialByName("Desk.018").roughness = 0.72;
scene.getMaterialByName("材质.29").metallic = 0.8;
}; };
// createScene function that creates and return the scene // createScene function that creates and return the scene
@ -494,6 +532,14 @@ var createScene = function() {
scene.activeCamera.useInputToRestoreState = true; scene.activeCamera.useInputToRestoreState = true;
var camera1_status = scene.activeCamera.storeState(); var camera1_status = scene.activeCamera.storeState();
var light = new BABYLON.HemisphericLight(
"HemiLight",
new BABYLON.Vector3(0, 1, 0),
scene
);
light.intensity = 2;
light.diffuse = new BABYLON.Color3(0.92, 0.92, 0.92);
var assetsManager = new BABYLON.AssetsManager(scene); var assetsManager = new BABYLON.AssetsManager(scene);
var meshTask = assetsManager.addMeshTask( var meshTask = assetsManager.addMeshTask(
"skull task", "skull task",
@ -791,7 +837,7 @@ var scene = createScene();
scene.autoClear = true; scene.autoClear = true;
scene.imageProcessingConfiguration.exposure = 1; scene.imageProcessingConfiguration.exposure = 1;
scene.imageProcessingConfiguration.contrast = 1; scene.imageProcessingConfiguration.contrast = 1;
scene.environmentIntensity = 1;
scene.environmentIntensity = 0.4;
engine.runRenderLoop(function() { engine.runRenderLoop(function() {
scene.render(); scene.render();
}); });
@ -932,4 +978,4 @@ window.addEventListener(
deviceData = e.data.data; deviceData = e.data.data;
}, },
false false
);
);

104
public/webC/index.js

@ -290,37 +290,38 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
prepareGroupButtonOther(camera08, new BABYLON.Color3(0, 0, 1)); prepareGroupButtonOther(camera08, new BABYLON.Color3(0, 0, 1));
prepareGroupButtonOther(yangan06, new BABYLON.Color3(0, 0, 1)); prepareGroupButtonOther(yangan06, new BABYLON.Color3(0, 0, 1));
//修改贴图
var bluexMat = new BABYLON.PBRMaterial("bluex", scene);
var tempddxa = new BABYLON.Texture("./asset/blue.png", scene);
var tempddxb = new BABYLON.Texture("./asset/blue.png", scene);
tempddxa.hasAlpha = true;
tempddxa.hasAlpha = true;
tempddxa.uAng = 180 * Math.PI / 180;
tempddxb.uAng = 180 * Math.PI / 180;
bluexMat.useAlphaFromAlbedoTexture = true;
bluexMat.albedoTexture =tempddxa;
bluexMat.reflectionColor = new BABYLON.Color3(0,0,0);
bluexMat.lightmapTexture =tempddxb;
scene.getMeshByName("平面_1").material = bluexMat;
var redMat = new BABYLON.PBRMaterial("redMat", scene);
var tempddx2 = new BABYLON.Texture("./asset/red.png", scene);
var tempddx3 = new BABYLON.Texture("./asset/red.png", scene);
tempddx2.hasAlpha = true;
tempddx3.hasAlpha = true;
tempddx2.uAng = 180 * Math.PI / 180;
tempddx3.uAng = 180 * Math.PI / 180;
redMat.useAlphaFromAlbedoTexture = true;
redMat.reflectionColor = new BABYLON.Color3(0,0,0);
//redMat.emissiveTexture =tempddx2;
redMat.albedoTexture =tempddx2;
redMat.lightmapTexture =tempddx3;
scene.getMeshByName("平面_1_2").material = redMat;
//修改贴图
var bluexMat = new BABYLON.PBRMaterial("bluex", scene);
var tempddxa = new BABYLON.Texture("./asset/blue.png", scene);
var tempddxb = new BABYLON.Texture("./asset/blue.png", scene);
tempddxa.hasAlpha = true;
tempddxa.hasAlpha = true;
tempddxa.uAng = (180 * Math.PI) / 180;
tempddxb.uAng = (180 * Math.PI) / 180;
bluexMat.useAlphaFromAlbedoTexture = true;
bluexMat.albedoTexture = tempddxa;
bluexMat.reflectionColor = new BABYLON.Color3(0, 0, 0);
bluexMat.lightmapTexture = tempddxb;
scene.getMeshByName("平面_1").material = bluexMat;
var redMat = new BABYLON.PBRMaterial("redMat", scene);
var tempddx2 = new BABYLON.Texture("./asset/red.png", scene);
var tempddx3 = new BABYLON.Texture("./asset/red.png", scene);
tempddx2.hasAlpha = true;
tempddx3.hasAlpha = true;
tempddx2.uAng = (180 * Math.PI) / 180;
tempddx3.uAng = (180 * Math.PI) / 180;
redMat.useAlphaFromAlbedoTexture = true;
redMat.reflectionColor = new BABYLON.Color3(0, 0, 0);
//redMat.emissiveTexture =tempddx2;
redMat.albedoTexture = tempddx2;
redMat.lightmapTexture = tempddx3;
scene.getMeshByName("平面_1_2").material = redMat;
var font_size = 48; var font_size = 48;
var font = "bold " + font_size + "px Arial"; var font = "bold " + font_size + "px Arial";
@ -384,7 +385,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat2 = new BABYLON.StandardMaterial("mat2", scene); var mat2 = new BABYLON.StandardMaterial("mat2", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat2.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat2.emissiveTexture = dynamicTexture2; mat2.emissiveTexture = dynamicTexture2;
mat2.reflectivityColor = new BABYLON.Color3(0, 0, 0); mat2.reflectivityColor = new BABYLON.Color3(0, 0, 0);
@ -409,7 +410,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat3 = new BABYLON.StandardMaterial("mat3", scene); var mat3 = new BABYLON.StandardMaterial("mat3", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat3.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat3.emissiveTexture = dynamicTexture3; mat3.emissiveTexture = dynamicTexture3;
mat3.reflectivityColor = new BABYLON.Color3(0, 0, 0); mat3.reflectivityColor = new BABYLON.Color3(0, 0, 0);
@ -434,7 +435,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var mat4 = new BABYLON.StandardMaterial("mat4", scene); var mat4 = new BABYLON.StandardMaterial("mat4", scene);
//mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1); //mat.albedoColor = new BABYLON.Color4(0.7968, 0.3685, 0.1105, 1);
mat4.disableLighting = true;
//mat2.ambientTexture = dynamicTexture2; //mat2.ambientTexture = dynamicTexture2;
mat4.emissiveTexture = dynamicTexture4; mat4.emissiveTexture = dynamicTexture4;
mat4.reflectivityColor = new BABYLON.Color3(0, 0, 0); mat4.reflectivityColor = new BABYLON.Color3(0, 0, 0);
@ -449,6 +450,37 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
scene.getMeshByName("tapblue").setEnabled(false); scene.getMeshByName("tapblue").setEnabled(false);
scene.getMeshByName("tapred").setEnabled(false); scene.getMeshByName("tapred").setEnabled(false);
var light = new BABYLON.HemisphericLight(
"HemiLight",
new BABYLON.Vector3(0, 1, 0),
scene
);
light.intensity = 2;
light.diffuse = new BABYLON.Color3(0.92, 0.92, 0.92);
scene.getMaterialByName("cover_label.001").metallic = 0.36;
scene.getMaterialByName("cover_label.001").albedoColor = new BABYLON.Color3(
1,
1,
1
);
scene.getMaterialByName("Desk.001").metallic = 0.8;
scene.getMaterialByName("Desk.001").roughness = 0.72;
scene.getMaterialByName("Desk.005").metallic = 0.8;
scene.getMaterialByName("Desk.005").roughness = 0.72;
scene.getMaterialByName("Desk.006").metallic = 0.8;
scene.getMaterialByName("Desk.006").roughness = 0.72;
var plane = BABYLON.MeshBuilder.CreatePlane(
"plane",
{ width: 10, height: 10 },
scene
);
plane.position = new BABYLON.Vector3(0.11, 1.93, -0.28);
plane.rotation = new BABYLON.Vector3((90 * Math.PI) / 180, 0, 0);
plane.scaling = new BABYLON.Vector3(1.2, 0.8, 1);
}; };
// createScene function that creates and return the scene // createScene function that creates and return the scene
@ -742,7 +774,7 @@ var scene = createScene();
scene.autoClear = true; scene.autoClear = true;
scene.imageProcessingConfiguration.exposure = 1; scene.imageProcessingConfiguration.exposure = 1;
scene.imageProcessingConfiguration.contrast = 1; scene.imageProcessingConfiguration.contrast = 1;
scene.environmentIntensity = 1;
scene.environmentIntensity = 0.4;
engine.runRenderLoop(function() { engine.runRenderLoop(function() {
scene.render(); scene.render();
}); });
@ -888,4 +920,4 @@ window.addEventListener(
deviceData = e.data.data; deviceData = e.data.data;
}, },
false false
);
);

179
public/webTotal/index.js

@ -231,9 +231,11 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
var dag2 = scene.getTransformNodeByName("B区"); var dag2 = scene.getTransformNodeByName("B区");
var dag3 = scene.getTransformNodeByName("C区"); var dag3 = scene.getTransformNodeByName("C区");
prepareGroupButton(dag1, new BABYLON.Color3(1, 1, 0), "A区");
prepareGroupButton(dag2, new BABYLON.Color3(1, 1, 0), "B区");
prepareGroupButton(dag3, new BABYLON.Color3(1, 1, 0), "C区");
var colorddd = new BABYLON.Color3(51 / 255, 156 / 255, 1);
prepareGroupButton(dag1, colorddd, "A区");
prepareGroupButton(dag2, colorddd, "B区");
prepareGroupButton(dag3, colorddd, "C区");
//绑功能点 //绑功能点
var cl = new BABYLON.Color3(0, 0, 1); var cl = new BABYLON.Color3(0, 0, 1);
@ -321,49 +323,49 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
x.overlayColor = BABYLON.Color3.White(); x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true; x.renderOverlay = true;
x = scene.getMeshByName("墙体");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("墙体");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_9_2");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_9_2");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_2_17.001_primitive0");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_2_17.001_primitive0");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_2_17.001_primitive1");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_2_17.001_primitive1");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_2_17.001_primitive2");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_2_17.001_primitive2");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_2_17.001_primitive3");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_2_17.001_primitive3");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_12_2_primitive0");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_12_2_primitive0");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_12_2_primitive1");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_12_2_primitive1");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
//x = scene.getMeshByName("立方体_12_2_primitive2"); //x = scene.getMeshByName("立方体_12_2_primitive2");
//x.overlayColor = BABYLON.Color3.White() //x.overlayColor = BABYLON.Color3.White()
//x.renderOverlay = true; //x.renderOverlay = true;
x = scene.getMeshByName("立方体_12_2_primitive3");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_12_2_primitive3");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_12_2_primitive4");
x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true;
// x = scene.getMeshByName("立方体_12_2_primitive4");
// x.overlayColor = BABYLON.Color3.White();
// x.renderOverlay = true;
x = scene.getMeshByName("立方体_5_2.001_LOD1_primitive0"); x = scene.getMeshByName("立方体_5_2.001_LOD1_primitive0");
x.overlayColor = BABYLON.Color3.White(); x.overlayColor = BABYLON.Color3.White();
@ -376,6 +378,113 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
x = scene.getMeshByName("立方体_1_12.001_LOD1"); x = scene.getMeshByName("立方体_1_12.001_LOD1");
x.overlayColor = BABYLON.Color3.White(); x.overlayColor = BABYLON.Color3.White();
x.renderOverlay = true; x.renderOverlay = true;
var light = new BABYLON.HemisphericLight(
"HemiLight",
new BABYLON.Vector3(0, 1, 0),
scene
);
light.intensity = 2;
light.diffuse = new BABYLON.Color3(0.92, 0.92, 0.92);
var material1 = scene.getMaterialByName("材质.107");
material1.albedoColor = new BABYLON.Color3(168 / 255, 167 / 255, 168 / 255);
material1.roughness = 1;
//墙
scene.getMaterialByName("cover_label.009").metallic = 0.36;
scene.getMaterialByName("cover_label.009").albedoColor = new BABYLON.Color3(
1,
1,
1
);
scene.getMaterialByName("cover_label.010").metallic = 0.36;
scene.getMaterialByName("cover_label.010").albedoColor = new BABYLON.Color3(
1,
1,
1
);
//铁
var material3 = scene.getMaterialByName("材质.116");
material3.metallic = 0.9;
material3.roughness = 0;
material3.emissiveColor = new BABYLON.Color3(0.278, 0.278, 0.278);
scene.getMaterialByName("材质.102").metallic = 0.9;
scene.getMaterialByName("材质.102").roughness = 0.0;
scene.getMaterialByName("材质.102").emissiveColor = new BABYLON.Color3(
0.278,
0.278,
0.278
);
scene.getMaterialByName("材质.132").metallic = 0.9;
scene.getMaterialByName("材质.132").roughness = 0.0;
scene.getMaterialByName("材质.132").emissiveColor = new BABYLON.Color3(
0.278,
0.278,
0.278
);
scene.getMaterialByName("材质.122").metallic = 0.9;
scene.getMaterialByName("材质.122").roughness = 0.0;
scene.getMaterialByName("材质.122").emissiveColor = new BABYLON.Color3(
0.278,
0.278,
0.278
);
//地
var material2 = scene.getMaterialByName("材质.106");
material2.albedoColor = new BABYLON.Color3(0.8, 0.8, 0.8);
material2.metallic = 0.52;
material2.roughness = 0;
//material2.metallicReflectanceColor=new BABYLON.Color3(1,0,0);
//material2.emissiveColor=new BABYLON.Color3(0.8,0.8,0.8);
//地面扩大处理
var meshground1 = scene.getMeshByName("地面A").clone();
var meshground = scene.getMeshByName("地面A");
meshground.isVisible = false;
meshground1.position = new BABYLON.Vector3(-1.512, -0.069, 1.852);
meshground1.scaling = new BABYLON.Vector3(0.022, 0.013, 0.005);
meshground1.parent = scene.getMeshByName("__root__");
//scene.getMeshByName("地面.002").isVisible = false;
//scene.getMeshByName("地面.003").isVisible = false;
//scene.getMeshByName("地面").isVisible = false;
scene.getMaterialByName("材质.127").metallic = 0.8;
scene.getMaterialByName("Wood-04.004").metallic = 0.8;
scene.getMaterialByName("Wood-04.004").metallic = 0.8;
scene.getMaterialByName("Desk.002").metallic = 0.8;
scene.getMaterialByName("Desk.002").roughness = 0.72;
scene.getMaterialByName("Desk.003").metallic = 0.8;
scene.getMaterialByName("Desk.003").roughness = 0.72;
scene.getMaterialByName("Desk.004").metallic = 0.8;
scene.getMaterialByName("Desk.004").roughness = 0.72;
scene.getMaterialByName("Desk.007").metallic = 0.8;
scene.getMaterialByName("Desk.007").roughness = 0.72;
scene.getMaterialByName("Desk.008").metallic = 0.8;
scene.getMaterialByName("Desk.008").roughness = 0.72;
scene.getMaterialByName("Desk.009").metallic = 0.8;
scene.getMaterialByName("Desk.009").roughness = 0.72;
scene.getMaterialByName("Desk.019").metallic = 0.8;
scene.getMaterialByName("Desk.019").roughness = 0.72;
scene.getMaterialByName("Desk.020").metallic = 0.8;
scene.getMaterialByName("Desk.020").roughness = 0.72;
scene.getMaterialByName("Desk.021").metallic = 0.8;
scene.getMaterialByName("Desk.021").roughness = 0.72;
scene.getMaterialByName("Desk.022").metallic = 0.8;
scene.getMaterialByName("Desk.022").roughness = 0.72;
scene.getMaterialByName("Desk.023").metallic = 0.8;
scene.getMaterialByName("Desk.023").roughness = 0.72;
scene.getMaterialByName("Desk.024").metallic = 0.8;
scene.getMaterialByName("Desk.024").roughness = 0.72;
}; };
// createScene function that creates and return the scene // createScene function that creates and return the scene
@ -392,7 +501,7 @@ var createScene = function() {
new BABYLON.Vector3(0, -1, 0), new BABYLON.Vector3(0, -1, 0),
scene scene
); );
camera.setTarget(new BABYLON.Vector3(0.5, 2, -4));
camera.setTarget(new BABYLON.Vector3(0, 2, 0));
camera.attachControl(canvas, true); camera.attachControl(canvas, true);
camera.lowerRadiusLimit = 2.0; // 这里是最大的位置,值越大,物体越小 camera.lowerRadiusLimit = 2.0; // 这里是最大的位置,值越大,物体越小
camera.upperRadiusLimit = 40; camera.upperRadiusLimit = 40;
@ -779,7 +888,7 @@ var scene = createScene();
scene.autoClear = true; scene.autoClear = true;
scene.imageProcessingConfiguration.exposure = 1; scene.imageProcessingConfiguration.exposure = 1;
scene.imageProcessingConfiguration.contrast = 1; scene.imageProcessingConfiguration.contrast = 1;
scene.environmentIntensity = 1;
scene.environmentIntensity = 0.4;
engine.runRenderLoop(function() { engine.runRenderLoop(function() {
scene.render(); scene.render();
}); });

Loading…
Cancel
Save