1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
| let balconyPosition = new THREE.Vector3(0, 0, 15); let balconyIndex = 8; let balconyUrl = "./https://636f-codesigner-3gyd7y6tb240bd1c-1316695488.tcb.qcloud.la/image-save-1/balcony"; let balconyEuler = new THREE.Euler(0, Math.PI / 16, 0); const balcony = new Room( "阳台", balconyIndex, balconyUrl, balconyPosition, balconyEuler );
const textBalcony = new SpriteCanvas( camera, "阳台", new THREE.Vector3(0, 0, 3) ); scene.add(textBalcony.mesh); textBalcony.onClick(() => { console.log("阳台"); gsap.to(camera.position, { x: balconyPosition.x, y: balconyPosition.y, z: balconyPosition.z, duration: 1, }); });
const textBalconyToLiving = new SpriteCanvas( camera, "客厅", new THREE.Vector3(-1, 0, 11) ); scene.add(textBalconyToLiving.mesh); textBalconyToLiving.onClick(() => { console.log("客厅"); gsap.to(camera.position, { x: livingPosition.x, y: livingPosition.y, z: livingPosition.z, duration: 1, }); });
let hallwayPosition = new THREE.Vector3(-15, 0, 0); let hallwayIndex = 9; let hallwayUrl = "./https://636f-codesigner-3gyd7y6tb240bd1c-1316695488.tcb.qcloud.la/image-save-1/corridor"; let hallwayEuler = new THREE.Euler(0, -Math.PI + Math.PI / 16, 0); const hallway = new Room( "走廊", hallwayIndex, hallwayUrl, hallwayPosition, hallwayEuler );
const textCorridor = new SpriteCanvas( camera, "走廊", new THREE.Vector3(-4, 0, 0.5) ); scene.add(textCorridor.mesh); textCorridor.onClick(() => { console.log("走廊"); gsap.to(camera.position, { x: hallwayPosition.x, y: hallwayPosition.y, z: hallwayPosition.z, duration: 1, }); });
const textCorridorToLiving = new SpriteCanvas( camera, "客厅", new THREE.Vector3(-11, 0, 0) ); scene.add(textCorridorToLiving.mesh); textCorridorToLiving.onClick(() => { console.log("客厅"); gsap.to(camera.position, { x: livingPosition.x, y: livingPosition.y, z: livingPosition.z, duration: 1, }); });
let mainPosition = new THREE.Vector3(-25, 0, 2); let mainIndex = 18; let mainUrl = "./https://636f-codesigner-3gyd7y6tb240bd1c-1316695488.tcb.qcloud.la/image-save-1/bedroom"; const main = new Room( "主卧", mainIndex, mainUrl, mainPosition ); const textMain = new SpriteCanvas( camera, "主卧", new THREE.Vector3(-19, 0, 2) ); scene.add(textMain.mesh); textMain.onClick(() => { console.log("主卧"); gsap.to(camera.position, { x: mainPosition.x, y: mainPosition.y, z: mainPosition.z, duration: 1, }); }); const textMainToCorridor = new SpriteCanvas( camera, "走廊", new THREE.Vector3(-23, 0, -2) ); scene.add(textMainToCorridor.mesh); textMainToCorridor.onClick(() => { console.log("走廊"); gsap.to(camera.position, { x: hallwayPosition.x, y: hallwayPosition.y, z: hallwayPosition.z, duration: 1, }); });
|