diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-01-29 20:39:26 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-01-29 20:39:26 +0100 |
| commit | a852b97060727428b8be55717b9dca4149f4368a (patch) | |
| tree | cecc93c412117021c4201b72189844fe6377f79a /client/splash/face/markers.js | |
| parent | 20c04cbe5d5d4072bcb2bd098fc9dd88577398cb (diff) | |
add modal
Diffstat (limited to 'client/splash/face/markers.js')
| -rw-r--r-- | client/splash/face/markers.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/client/splash/face/markers.js b/client/splash/face/markers.js index 20a96fb6..354ed68c 100644 --- a/client/splash/face/markers.js +++ b/client/splash/face/markers.js @@ -42,7 +42,11 @@ export function build(points) { quaternion.setFromEuler(rotation, false) matrix.compose(position.clone(), quaternion, boxScale) geometry.applyMatrix(matrix) - let material = new THREE.MeshBasicMaterial({ color: boxColor }) + let material = new THREE.MeshBasicMaterial({ + color: boxColor, + opacity: 1, + transparent: true, + }) let cube = new THREE.Mesh(geometry, material) group.add(cube) return cube @@ -52,6 +56,9 @@ export function build(points) { const color = new THREE.Color() const material = new MeshLineMaterial({ color: color.setHex(MARKER_COLORS[i % MARKER_COLORS.length]), + alphaTest: 0.01, + opacity: 1.0, + transparent: true, }) const line = new MeshLine() line.setGeometry(geometry, () => LINE_THICKNESS) @@ -60,13 +67,23 @@ export function build(points) { group.add(mesh) return [line, mesh] }) - + window.meshes = meshes group.frustumCulled = false scene.add(group) updateFace(scaledPoints, cubes, meshes) } +export function fadePointsTo(opacity) { + cubes.forEach(cube => cube.material.opacity = opacity) +} +export function fadeLinesTo(opacity) { + meshes.forEach((pair) => { + pair[1].material.uniforms.visibility.value = opacity + pair[1].material.uniformsNeedUpdate = true + }) +} + function scalePoints(points) { const bbox = getBboxForPoints(points) let { scale, midX, midY, midZ } = getBboxScaleAndCentroid(bbox) |
