1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| const vertices = new Float32Array([ 0.5, 0, 1, 0, 0.5, 0.2, 1, 0.2, 1, 0, 0.5, 0, 1, 0.2, 0.5, 0.2, 1, 0, 0.5, 0, 1, 0.6, 0.5, 0.6, 1, 0.6, 0.5, 0.6, 1, 0, 0.5, 0, 0.5, 0.8, 1, 0.8, 0.5, 0.6, 1, 0.6, 0.5, 1, 1, 1, 0.5, 0.8, 1, 0.8, ])
const box = new THREE.BoxBufferGeometry(6, rackUnitSize, 6) box.setAttribute('uv', new THREE.BufferAttribute(vertices, 2)) const boxMaterial = new THREE.MeshBasicMaterial({ map: new THREE.TextureLoader().load('statics/textures/server.jpg'), })
return new THREE.Mesh(box, boxMaterial)
|