@eturnity/eturnity_3d 6.34.0 → 6.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +5 -0
- package/package.json +8 -4
- package/src/App.vue +16 -16
- package/src/assets/theme.js +4 -4
- package/src/components/ThreeCanvasViewer.vue +56 -43
- package/src/config.js +139 -65
- package/src/helper/MapView.js +214 -241
- package/src/helper/UpdateRoofModuleFieldRelations.js +17 -23
- package/src/helper/UpdateRoofObstacleRelations.js +48 -41
- package/src/helper/cameraMixin.js +97 -93
- package/src/helper/customProvider.js +28 -28
- package/src/helper/materialMixin.js +86 -70
- package/src/helper/materials.js +64 -49
- package/src/helper/render/background.js +2 -5
- package/src/helper/render/base.js +43 -40
- package/src/helper/render/clear.js +96 -84
- package/src/helper/render/edge.js +59 -65
- package/src/helper/render/geometryHandler.js +166 -128
- package/src/helper/render/imageOverlay.js +157 -106
- package/src/helper/render/index.js +21 -3
- package/src/helper/render/loader.js +34 -34
- package/src/helper/render/mapProjection.js +88 -74
- package/src/helper/render/margin.js +46 -50
- package/src/helper/render/moduleField.js +26 -24
- package/src/helper/render/node.js +43 -43
- package/src/helper/render/obstacle.js +50 -48
- package/src/helper/render/panel.js +85 -79
- package/src/helper/render/projectionMaterial.js +58 -50
- package/src/helper/render/roof.js +136 -133
- package/src/helper/render/texture.js +17 -17
- package/src/helper/render/tile.js +291 -0
- package/src/helper/renderMixin.js +30 -37
- package/src/helper/threeMixin.js +40 -101
- package/src/main.js +22 -18
- package/src/store/AddMargin.js +87 -83
- package/src/store/hydrateData.js +40 -30
- package/src/store/nodesEdgesCreation.js +177 -160
- package/src/store/three-d-module.js +41 -27
- package/src/utils/cancellablePromise.js +23 -0
- package/.eslintrc.json +0 -18
- package/src/helper/geo-three.module.js +0 -1903
|
@@ -1,97 +1,101 @@
|
|
|
1
1
|
import TWEEN from 'tween'
|
|
2
|
-
import {
|
|
3
|
-
addVector,
|
|
4
|
-
multiplyVector,
|
|
5
|
-
} from '@eturnity/eturnity_maths'
|
|
2
|
+
import { addVector, multiplyVector } from '@eturnity/eturnity_maths'
|
|
6
3
|
|
|
7
4
|
export default {
|
|
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
|
-
|
|
5
|
+
methods: {
|
|
6
|
+
setCameraGlobalPosition() {
|
|
7
|
+
if (this.roofs.length == 0) return
|
|
8
|
+
let bounds = this.roofsBounds
|
|
9
|
+
let targetVector = {
|
|
10
|
+
x: (bounds.xMax + bounds.xMin) / 2000,
|
|
11
|
+
y: (bounds.yMax + bounds.yMin) / 2000,
|
|
12
|
+
z: 0
|
|
13
|
+
}
|
|
14
|
+
let objectRadius_m = Math.max(
|
|
15
|
+
(bounds.xMax - bounds.xMin) / 2000,
|
|
16
|
+
(bounds.yMax - bounds.yMin) / 2000
|
|
17
|
+
)
|
|
18
|
+
let distance =
|
|
19
|
+
5 + objectRadius_m / Math.sin(((this.camera.fov / 2) * Math.PI) / 180)
|
|
20
|
+
let cameraMoveVector = { x: 0, y: 0, z: distance }
|
|
21
|
+
const positionVector = addVector(targetVector, cameraMoveVector)
|
|
22
|
+
const position = [
|
|
23
|
+
positionVector.x,
|
|
24
|
+
positionVector.y - distance,
|
|
25
|
+
positionVector.z
|
|
26
|
+
]
|
|
27
|
+
let target = [targetVector.x, targetVector.y, targetVector.z]
|
|
28
|
+
|
|
29
|
+
this.setTweenTo(position, target)
|
|
30
|
+
},
|
|
31
|
+
setCameraOrthogonalTo(polygon) {
|
|
32
|
+
if (polygon) {
|
|
33
|
+
let polygonRef = polygon
|
|
34
|
+
const targetVector = polygonRef.meanPoint
|
|
35
|
+
const target = [
|
|
36
|
+
targetVector.x / 1000,
|
|
37
|
+
targetVector.y / 1000,
|
|
38
|
+
targetVector.z / 1000
|
|
39
|
+
]
|
|
40
|
+
const positionVector = addVector(
|
|
41
|
+
polygonRef.meanPoint,
|
|
42
|
+
multiplyVector(45000, polygonRef.normalVector)
|
|
43
|
+
)
|
|
44
|
+
const position = [
|
|
45
|
+
positionVector.x / 1000,
|
|
46
|
+
positionVector.y / 1000 - 1,
|
|
47
|
+
positionVector.z / 1000
|
|
48
|
+
]
|
|
49
|
+
this.setTweenTo(position, target)
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
setCameraSideTo(polygon) {
|
|
53
|
+
if (polygon) {
|
|
54
|
+
let polygonRef = polygon
|
|
55
|
+
const targetVector = polygonRef.meanPoint
|
|
56
|
+
const target = [
|
|
57
|
+
targetVector.x / 1000,
|
|
58
|
+
targetVector.y / 1000,
|
|
59
|
+
targetVector.z / 1000
|
|
60
|
+
]
|
|
61
|
+
let sideVector = {
|
|
62
|
+
x: -Math.cos(((polygonRef.direction + 45) * Math.PI) / 180),
|
|
63
|
+
y: Math.sin(((polygonRef.direction + 45) * Math.PI) / 180),
|
|
64
|
+
z: 0
|
|
65
|
+
}
|
|
66
|
+
const positionVector = addVector(
|
|
67
|
+
polygonRef.meanPoint,
|
|
68
|
+
multiplyVector(45000, sideVector)
|
|
69
|
+
)
|
|
70
|
+
const position = [
|
|
71
|
+
positionVector.x / 1000,
|
|
72
|
+
positionVector.y / 1000,
|
|
73
|
+
positionVector.z / 1000 + 5
|
|
74
|
+
]
|
|
75
|
+
this.setTweenTo(position, target)
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
setTweenTo(position, target) {
|
|
79
|
+
if (this.orbitControl) {
|
|
80
|
+
this.tweenOrbit = new TWEEN.Tween(this.orbitControl.target)
|
|
81
|
+
.to({ x: target[0], y: target[1], z: target[2] }, 2000)
|
|
82
|
+
.easing(TWEEN.Easing.Sinusoidal.Out)
|
|
83
|
+
.onUpdate(() => {
|
|
84
|
+
if (this.orbitControl && this.orbitControl.update)
|
|
85
|
+
this.orbitControl.update()
|
|
86
|
+
})
|
|
87
|
+
.start()
|
|
88
|
+
}
|
|
89
|
+
if (this.camera) {
|
|
90
|
+
this.tweenCamera = new TWEEN.Tween(this.camera.position)
|
|
91
|
+
.to({ x: position[0], y: position[1], z: position[2] }, 2000)
|
|
92
|
+
.easing(TWEEN.Easing.Sinusoidal.Out)
|
|
93
|
+
.onUpdate(() => {
|
|
94
|
+
if (this.orbitControl && this.orbitControl.update)
|
|
95
|
+
this.orbitControl.update()
|
|
96
|
+
})
|
|
97
|
+
.start()
|
|
98
|
+
}
|
|
96
99
|
}
|
|
97
|
-
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MapProvider,
|
|
3
|
-
} from 'geo-three'
|
|
1
|
+
import { MapProvider } from 'geo-three'
|
|
4
2
|
import getLayers from '../utils/layers'
|
|
5
3
|
export class CustomProvider extends MapProvider {
|
|
6
4
|
constructor(address, map_layer) {
|
|
7
5
|
super()
|
|
8
|
-
|
|
6
|
+
|
|
9
7
|
const layer = getLayers().find((layer) => layer.key == map_layer)
|
|
10
8
|
this.layer = layer
|
|
11
|
-
|
|
9
|
+
this.mapLayer = map_layer
|
|
10
|
+
this.maxZoom = this.layer.layerData.options.maxNativeZoom || 20
|
|
12
11
|
this.defaultImage = document.createElement('img')
|
|
13
|
-
this.defaultImage.src=require('../assets/images/white_tile.png')
|
|
12
|
+
this.defaultImage.src = require('../assets/images/white_tile.png')
|
|
14
13
|
this.defaultImage.crossOrigin = 'Anonymous'
|
|
15
14
|
this.url = layer
|
|
16
15
|
? layer.layerData._url
|
|
@@ -22,16 +21,13 @@ export class CustomProvider extends MapProvider {
|
|
|
22
21
|
const minZoomLayer = this.layer.layerData.options.minZoom || 9
|
|
23
22
|
const maxZoomLayer = this.layer.layerData.options.maxNativeZoom || 20
|
|
24
23
|
return new Promise((resolve, reject) => {
|
|
25
|
-
|
|
26
24
|
if (zoom < minZoomLayer) {
|
|
27
|
-
|
|
28
|
-
} else if(zoom > maxZoomLayer){
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
25
|
+
resolve(this.defaultImage)
|
|
26
|
+
} else if (zoom > maxZoomLayer) {
|
|
27
|
+
} else {
|
|
32
28
|
var image = document.createElement('img')
|
|
33
29
|
image.onload = function () {
|
|
34
|
-
image.style.backgroundColor=
|
|
30
|
+
image.style.backgroundColor = 'red'
|
|
35
31
|
resolve(image)
|
|
36
32
|
}
|
|
37
33
|
image.onerror = function () {
|
|
@@ -40,33 +36,37 @@ export class CustomProvider extends MapProvider {
|
|
|
40
36
|
|
|
41
37
|
image.crossOrigin = 'Anonymous'
|
|
42
38
|
let imageSrc = this.url
|
|
43
|
-
if(this.layer.key==
|
|
44
|
-
const numTiles = Math.pow(2, zoom)
|
|
45
|
-
const tileX = x
|
|
46
|
-
const tileY =
|
|
47
|
-
const earthPerimeter=6378137*Math.PI*2
|
|
48
|
-
const resolution_mPerTile=earthPerimeter/numTiles
|
|
39
|
+
if (this.layer.key == 'bkgHexagonGermanyLayer') {
|
|
40
|
+
const numTiles = Math.pow(2, zoom)
|
|
41
|
+
const tileX = x
|
|
42
|
+
const tileY = numTiles - 1 - y
|
|
43
|
+
const earthPerimeter = 6378137 * Math.PI * 2
|
|
44
|
+
const resolution_mPerTile = earthPerimeter / numTiles
|
|
49
45
|
|
|
50
|
-
const xMin=tileX*resolution_mPerTile-
|
|
51
|
-
const xMax=xMin+resolution_mPerTile
|
|
52
|
-
const yMin=tileY*resolution_mPerTile-
|
|
53
|
-
const yMax=yMin+resolution_mPerTile
|
|
46
|
+
const xMin = tileX * resolution_mPerTile - earthPerimeter / 2
|
|
47
|
+
const xMax = xMin + resolution_mPerTile
|
|
48
|
+
const yMin = tileY * resolution_mPerTile - earthPerimeter / 2
|
|
49
|
+
const yMax = yMin + resolution_mPerTile
|
|
54
50
|
|
|
55
|
-
imageSrc
|
|
56
|
-
}else{
|
|
51
|
+
imageSrc += `&service=WMS&request=GetMap&layers=rgb&styles=&format=image%2Fjpeg&transparent=false&version=1.1.1&id=bkg_image&layerTypeAPI=bkgHexagonGermanyLayer&width=256&height=256&srs=EPSG%3A3857&bbox=${xMin},${yMin},${xMax},${yMax}`
|
|
52
|
+
} else {
|
|
57
53
|
imageSrc = imageSrc.replace('{x}', x)
|
|
58
54
|
imageSrc = imageSrc.replace('{y}', y)
|
|
59
55
|
imageSrc = imageSrc.replace('{z}', zoom)
|
|
60
56
|
//imageSrc = imageSrc.replace('{s}', 'a')
|
|
61
|
-
if(this.layer.layerData.options.subdomains){
|
|
62
|
-
const subDomain=
|
|
57
|
+
if (this.layer.layerData.options.subdomains) {
|
|
58
|
+
const subDomain =
|
|
59
|
+
this.layer.layerData.options.subdomains[
|
|
60
|
+
Math.abs((x << zoom) + y) %
|
|
61
|
+
this.layer.layerData.options.subdomains.length
|
|
62
|
+
]
|
|
63
63
|
imageSrc = imageSrc.replace('{s}', subDomain)
|
|
64
64
|
}
|
|
65
65
|
imageSrc = imageSrc.replace('{format}', 'image/jpeg')
|
|
66
66
|
//imageSrc = imageSrc.replace('{format}', 'image/png')
|
|
67
67
|
imageSrc = imageSrc.replace('{tileMatrixSet}', 'PM')
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
image.src = imageSrc
|
|
70
70
|
}
|
|
71
71
|
})
|
|
72
72
|
}
|
|
@@ -1,75 +1,91 @@
|
|
|
1
1
|
import * as THREE from 'three'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
beamColor,
|
|
4
|
+
beamOpacity,
|
|
5
|
+
node3DColor,
|
|
6
|
+
node3dOpacity,
|
|
7
|
+
defaultTextureUrls
|
|
8
|
+
} from '../config'
|
|
3
9
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
material: {}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
created() {
|
|
16
|
+
let wallColor = 0xdddddd
|
|
17
|
+
if (this.wallColor) {
|
|
18
|
+
wallColor = new THREE.Color(this.wallColor)
|
|
19
|
+
}
|
|
20
|
+
this.material.wall = new THREE.MeshLambertMaterial({
|
|
21
|
+
color: wallColor,
|
|
22
|
+
side: THREE.DoubleSide
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
this.material.obstacle = new THREE.MeshPhongMaterial({
|
|
26
|
+
color: 0xff0000,
|
|
27
|
+
side: THREE.DoubleSide
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
this.material.edge = new THREE.MeshPhongMaterial({
|
|
31
|
+
color: beamColor,
|
|
32
|
+
transparent: true,
|
|
33
|
+
opacity: beamOpacity
|
|
34
|
+
})
|
|
35
|
+
this.material.node = new THREE.PointsMaterial({
|
|
36
|
+
size: 0.05,
|
|
37
|
+
sizeAttenuation: true,
|
|
38
|
+
color: node3DColor,
|
|
39
|
+
opacity: node3dOpacity,
|
|
40
|
+
transparent: true
|
|
41
|
+
})
|
|
42
|
+
const loader = new THREE.TextureLoader()
|
|
43
|
+
// loader.crossOrigin = 'anonymous'
|
|
44
|
+
// texture.minFilter = THREE.LinearFilter
|
|
45
|
+
this.material.panel = {}
|
|
46
|
+
|
|
47
|
+
for (let k = 0; k < defaultTextureUrls.length; k++) {
|
|
48
|
+
let texture = loader.load(defaultTextureUrls[k], function (texture) {})
|
|
49
|
+
this.material.panel['default_' + k] = new THREE.MeshBasicMaterial({
|
|
50
|
+
map: texture,
|
|
51
|
+
side: THREE.DoubleSide
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
this.material.roof = [this.material.wall]
|
|
55
|
+
|
|
56
|
+
this.material.flatRoof = new THREE.MeshPhongMaterial({
|
|
57
|
+
color: 0x00ff00,
|
|
58
|
+
specular: 0x009900,
|
|
59
|
+
shininess: 0,
|
|
60
|
+
flatShading: true,
|
|
61
|
+
side: THREE.DoubleSide,
|
|
62
|
+
transparent: true,
|
|
63
|
+
opacity: 0.5
|
|
64
|
+
})
|
|
18
65
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
specular: 0x009900,
|
|
43
|
-
shininess: 0,
|
|
44
|
-
flatShading: true,
|
|
45
|
-
side:THREE.DoubleSide,
|
|
46
|
-
transparent:true,
|
|
47
|
-
opacity:0.5
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
this.material.moduleField = new THREE.MeshPhongMaterial({
|
|
51
|
-
color: 0xfc9d03,
|
|
52
|
-
specular: 0x000000,
|
|
53
|
-
shininess: 0,
|
|
54
|
-
flatShading: true,
|
|
55
|
-
side:THREE.DoubleSide,
|
|
56
|
-
transparent:true,
|
|
57
|
-
opacity:0.8
|
|
58
|
-
})
|
|
59
|
-
this.material.curvedRoof = new THREE.MeshPhongMaterial({
|
|
60
|
-
color: 0xffff00,
|
|
61
|
-
specular: 0x009900,
|
|
62
|
-
shininess: 0,
|
|
63
|
-
flatShading: true,
|
|
64
|
-
side:THREE.DoubleSide,
|
|
65
|
-
transparent:true,
|
|
66
|
-
opacity:0.5
|
|
67
|
-
})
|
|
68
|
-
},
|
|
69
|
-
watch: {
|
|
70
|
-
wallColor(color) {
|
|
71
|
-
let wallColor = new THREE.Color(color)
|
|
72
|
-
this.material.wall.color.set(wallColor)
|
|
73
|
-
},
|
|
66
|
+
this.material.moduleField = new THREE.MeshPhongMaterial({
|
|
67
|
+
color: 0xfc9d03,
|
|
68
|
+
specular: 0x000000,
|
|
69
|
+
shininess: 0,
|
|
70
|
+
flatShading: true,
|
|
71
|
+
side: THREE.DoubleSide,
|
|
72
|
+
transparent: true,
|
|
73
|
+
opacity: 0.8
|
|
74
|
+
})
|
|
75
|
+
this.material.curvedRoof = new THREE.MeshPhongMaterial({
|
|
76
|
+
color: 0xffff00,
|
|
77
|
+
specular: 0x009900,
|
|
78
|
+
shininess: 0,
|
|
79
|
+
flatShading: true,
|
|
80
|
+
side: THREE.DoubleSide,
|
|
81
|
+
transparent: true,
|
|
82
|
+
opacity: 0.5
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
watch: {
|
|
86
|
+
wallColor(color) {
|
|
87
|
+
let wallColor = new THREE.Color(color)
|
|
88
|
+
this.material.wall.color.set(wallColor)
|
|
74
89
|
}
|
|
90
|
+
}
|
|
75
91
|
}
|
package/src/helper/materials.js
CHANGED
|
@@ -1,62 +1,77 @@
|
|
|
1
1
|
import * as THREE from 'three'
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
beamColor,
|
|
4
|
+
beamOpacity,
|
|
5
|
+
node3DColor,
|
|
6
|
+
node3dOpacity,
|
|
7
|
+
defaultTextureUrls
|
|
8
|
+
} from '../config'
|
|
9
|
+
const material = []
|
|
4
10
|
|
|
5
11
|
material.wall = new THREE.MeshLambertMaterial({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
color: 0xdddddd,
|
|
13
|
+
side: THREE.DoubleSide
|
|
14
|
+
})
|
|
9
15
|
|
|
10
16
|
// TODO get Canvas image from TwoD
|
|
11
17
|
material.obstacle = new THREE.MeshPhongMaterial({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
color: 0xff0000,
|
|
19
|
+
side: THREE.DoubleSide
|
|
20
|
+
})
|
|
15
21
|
|
|
16
|
-
material.edge=new THREE.MeshPhongMaterial({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
material.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
material.edge = new THREE.MeshPhongMaterial({
|
|
23
|
+
color: beamColor,
|
|
24
|
+
transparent: true,
|
|
25
|
+
opacity: beamOpacity
|
|
26
|
+
})
|
|
27
|
+
material.node = new THREE.PointsMaterial({
|
|
28
|
+
size: 0.05,
|
|
29
|
+
sizeAttenuation: true,
|
|
30
|
+
color: node3DColor,
|
|
31
|
+
opacity: node3dOpacity,
|
|
32
|
+
transparent: true
|
|
33
|
+
})
|
|
34
|
+
const loader = new THREE.TextureLoader()
|
|
35
|
+
// loader.crossOrigin = 'anonymous'
|
|
36
|
+
// texture.minFilter = THREE.LinearFilter
|
|
37
|
+
material.panel = {}
|
|
38
|
+
|
|
39
|
+
for (let k = 0; k < defaultTextureUrls.length; k++) {
|
|
40
|
+
let texture = loader.load(defaultTextureUrls[k], function (texture) {})
|
|
41
|
+
material.panel['default_' + k] = new THREE.MeshBasicMaterial({
|
|
42
|
+
map: texture,
|
|
43
|
+
side: THREE.DoubleSide,
|
|
44
|
+
transparent: true
|
|
45
|
+
})
|
|
46
|
+
}
|
|
31
47
|
|
|
32
48
|
material.flatRoof = new THREE.MeshPhongMaterial({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
color: 0x00ff00,
|
|
50
|
+
specular: 0x009900,
|
|
51
|
+
shininess: 0,
|
|
52
|
+
flatShading: true,
|
|
53
|
+
side: THREE.DoubleSide,
|
|
54
|
+
transparent: true,
|
|
55
|
+
opacity: 0.5
|
|
56
|
+
})
|
|
41
57
|
|
|
42
58
|
material.moduleField = new THREE.MeshPhongMaterial({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})
|
|
59
|
+
color: 0xfc9d03,
|
|
60
|
+
specular: 0x000000,
|
|
61
|
+
shininess: 0,
|
|
62
|
+
flatShading: true,
|
|
63
|
+
side: THREE.DoubleSide,
|
|
64
|
+
transparent: true,
|
|
65
|
+
opacity: 0.6
|
|
66
|
+
})
|
|
51
67
|
material.curvedRoof = new THREE.MeshPhongMaterial({
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
color: 0xffff00,
|
|
69
|
+
specular: 0x009900,
|
|
70
|
+
shininess: 0,
|
|
71
|
+
flatShading: true,
|
|
72
|
+
side: THREE.DoubleSide,
|
|
73
|
+
transparent: true,
|
|
74
|
+
opacity: 0.5
|
|
75
|
+
})
|
|
61
76
|
|
|
62
|
-
export {material}
|
|
77
|
+
export { material }
|