1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Added striped texture to visualize rooms without sensors

This commit is contained in:
Jon Ziebell 2022-09-12 07:32:43 -04:00
parent e6af646161
commit 74db0fb145
8 changed files with 18 additions and 8 deletions

View File

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

View File

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 165 KiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 168 KiB

BIN
img/visualize/stripe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -302,9 +302,8 @@ beestat.component.scene.prototype.update_raycaster_ = function() {
* @link http://alexcpeterson.com/spacescape/ * @link http://alexcpeterson.com/spacescape/
*/ */
beestat.component.scene.prototype.add_skybox_ = function() { beestat.component.scene.prototype.add_skybox_ = function() {
const skybox_name = 'cloudy';
const loader = new THREE.CubeTextureLoader(); const loader = new THREE.CubeTextureLoader();
loader.setPath('img/visualize/' + skybox_name + '/'); loader.setPath('img/visualize/skybox/');
const texture = loader.load([ const texture = loader.load([
'front.png', 'front.png',
'back.png', 'back.png',
@ -532,9 +531,6 @@ beestat.component.scene.prototype.add_room_ = function(layer, group, room) {
// Just the floor plan // Just the floor plan
const extrude_height = 6; const extrude_height = 6;
// Create a shape using the points of the room. // Create a shape using the points of the room.
const shape = new THREE.Shape(); const shape = new THREE.Shape();
const first_point = clipper_hole[0].shift(); const first_point = clipper_hole[0].shift();
@ -553,9 +549,23 @@ beestat.component.scene.prototype.add_room_ = function(layer, group, room) {
shape, shape,
extrude_settings extrude_settings
); );
const material = new THREE.MeshPhongMaterial({
'color': color let material;
}); if (room.sensor_id === undefined) {
const texture = new THREE.TextureLoader().load('img/visualize/stripe.png');
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set(0.005, 0.005);
material = new THREE.MeshPhongMaterial({
'map': texture
});
} else {
material = new THREE.MeshPhongMaterial({
'color': color
});
}
const mesh = new THREE.Mesh(geometry, material); const mesh = new THREE.Mesh(geometry, material);
mesh.position.z = -extrude_height - (room.elevation || group.elevation); mesh.position.z = -extrude_height - (room.elevation || group.elevation);