1
0
mirror of https://github.com/beestat/app.git synced 2025-06-03 05:36:51 -04:00

Fixed visualize rooms with no sensor showing up black before texture is loaded

This commit is contained in:
Jon Ziebell 2022-09-12 07:53:31 -04:00
parent f4c414d436
commit d91d6a9daf

View File

@ -550,20 +550,21 @@ beestat.component.scene.prototype.add_room_ = function(layer, group, room) {
extrude_settings extrude_settings
); );
let material; const material = new THREE.MeshPhongMaterial({
'color': color
});
if (room.sensor_id === undefined) { if (room.sensor_id === undefined) {
const texture = new THREE.TextureLoader().load('img/visualize/stripe.png'); const loader = new THREE.TextureLoader();
texture.wrapS = THREE.RepeatWrapping; loader.load(
texture.wrapT = THREE.RepeatWrapping; 'img/visualize/stripe.png',
texture.repeat.set(0.005, 0.005); function(texture) {
texture.wrapS = THREE.RepeatWrapping;
material = new THREE.MeshPhongMaterial({ texture.wrapT = THREE.RepeatWrapping;
'map': texture texture.repeat.set(0.005, 0.005);
}); material.map = texture;
} else { material.needsUpdate = true;
material = new THREE.MeshPhongMaterial({ }
'color': color );
});
} }
const mesh = new THREE.Mesh(geometry, material); const mesh = new THREE.Mesh(geometry, material);