| | |
| | | // this.camera.position.z = 600; |
| | | // //相机的朝向 |
| | | // this.camera.lookAt(0, 0, 0); |
| | | this.camera.position.set( - 350, 1070, 1550 ); |
| | | this.camera.position.set( -350, 650, 1100 ); |
| | | this.camera.lookAt( this.scene.position ); |
| | | //将相机放到场景中 |
| | | this.scene.add(this.camera); |
| | | } else { |
| | | this.camera.position.set( - 350, 1070, 1550 ); |
| | | this.camera.position.set( -350, 650, 1100 ); |
| | | this.camera.lookAt( this.scene.position ); |
| | | } |
| | | } |
| | |
| | | objectName: 'floor', |
| | | objectType: 'cube', |
| | | length: 2750, |
| | | width: 1200, |
| | | width: 800, |
| | | height: 1, |
| | | position: { |
| | | x: 1375, |
| | | y: 1, |
| | | z: 600 |
| | | y: 0, |
| | | z: 400 |
| | | }, |
| | | style:{ |
| | | color: 0x5F7480, |
| | |
| | | objectName: 'floor', |
| | | objectType: 'cube', |
| | | length: 2750, |
| | | width: 1200, |
| | | width: 800, |
| | | height: 1, |
| | | position: { |
| | | x: 1375, |
| | | y: 310, |
| | | z: 600 |
| | | z: 400 |
| | | }, |
| | | style:{ |
| | | color: 0x5F7480, |
| | |
| | | import {OBJLoader} from "../lib/OBJLoader.js"; |
| | | import {Color} from "../three.module.js"; |
| | | |
| | | const xOffset = -1658; |
| | | const yOffset = -553; |
| | | const zOffset = -1800; |
| | | const xOffset = 35; |
| | | const yOffset = 44; |
| | | const zOffset = 28; |
| | | |
| | | const xOffset0 = -1407; |
| | | const yOffset0 = 0; |
| | |
| | | object.addObject( clone ); |
| | | } |
| | | |
| | | for (let i = 0; i<24; i++) { |
| | | let clone = chain.clone(); |
| | | // roller.name = option.crnNo + "-body"; |
| | | let offset = 0; |
| | | if (i % 2 === 0) { |
| | | offset = 90; |
| | | } |
| | | clone.position.x = xOffset0 + 56 + offset + Math.floor(i/2)*230; |
| | | clone.position.y = yOffset0 + 310; |
| | | clone.position.z = zOffset0 + 39 + 82; |
| | | object.addObject( clone ); |
| | | } |
| | | |
| | | }, null, null ); |
| | | }); |
| | | |
| | |
| | | roller.traverse (function (child) { |
| | | if (child instanceof THREE.Mesh) { |
| | | child.material = new THREE.MeshLambertMaterial({ |
| | | color: 0xCD6839 |
| | | color: 0xAAAAAA |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | roller.scale.set(1000, 1000, 1000); |
| | | roller.rotateY(- Math.PI / 2); |
| | | roller.scale.set(55, 45, 55); |
| | | // roller.rotateY(- Math.PI / 2); |
| | | // roller.name = option.crnNo + "-body"; |
| | | roller.position.x = xOffset; |
| | | roller.position.x = xOffset + 60; |
| | | roller.position.y = yOffset; |
| | | roller.position.z = zOffset; |
| | | roller.position.z = zOffset + 140; |
| | | // object.addObject( roller ); |
| | | |
| | | }, null, null ); |
| | |
| | | document.getElementById("btn-lock").addEventListener('click', function () { |
| | | player.lockControl(); |
| | | removeClass(document.getElementById("ship-info-btn"), "show"); |
| | | removeClass(document.getElementById("title-box"), "show"); |
| | | document.getElementById("ship-type-ul").style.transform = 'translateY(-60px)'; |
| | | }, false); |
| | | |
| | |
| | | $("#ship-info-btn").data("type", 2).addClass("show"); |
| | | $("#ship-info-btn #btn-lock").css("z-index", "10"); |
| | | $("#menu li").css("transition", "all 200ms !important"); |
| | | }, 3000); // 1000 |
| | | setTimeout(function () { |
| | | removeClass(document.getElementById("title-box"), "show"); |
| | | }, 10000); |
| | | }, 1000); // 1000 |
| | | }); |
| | | $("#title-box, #logo").addClass("show"); |
| | | $("#ship-info-btn").removeClass("show"); |