bx-1379-redesign #15
|
@ -6,6 +6,7 @@ import {
|
||||||
Vector2, Vector3,
|
Vector2, Vector3,
|
||||||
CircleGeometry, MeshBasicMaterial,
|
CircleGeometry, MeshBasicMaterial,
|
||||||
Quaternion,
|
Quaternion,
|
||||||
|
RingGeometry,
|
||||||
} from 'three';
|
} from 'three';
|
||||||
|
|
||||||
import { useTresContext, useSeek, useTexture, useLoop } from '@tresjs/core';
|
import { useTresContext, useSeek, useTexture, useLoop } from '@tresjs/core';
|
||||||
|
@ -191,11 +192,24 @@ const loadModels = async () => {
|
||||||
|
|
||||||
const point_mesh = new Mesh(
|
const point_mesh = new Mesh(
|
||||||
new CircleGeometry(p, 32),
|
new CircleGeometry(p, 32),
|
||||||
new MeshBasicMaterial({ map: pointerTexture.map })
|
new MeshBasicMaterial({ color: new Color('#FFF'), side: DoubleSide })
|
||||||
)
|
)
|
||||||
point_mesh.rotateX(-0.5 * Math.PI)
|
point_mesh.rotateX(-0.5 * Math.PI)
|
||||||
|
const point_mesh2 = new Mesh(
|
||||||
|
new RingGeometry(p * 0.33, p * 0.66, 32),
|
||||||
|
new MeshBasicMaterial({
|
||||||
|
color: new Color(envVars.clear_color),
|
||||||
|
side: DoubleSide,
|
||||||
|
polygonOffset: true, polygonOffsetFactor: -4,
|
||||||
|
// polygonOffsetUnits: 0.1
|
||||||
|
})
|
||||||
|
)
|
||||||
|
point_mesh2.rotateX(-0.5 * Math.PI)
|
||||||
|
|
||||||
const point = new Group()
|
const point = new Group()
|
||||||
point.add(point_mesh)
|
point.add(point_mesh)
|
||||||
|
point.add(point_mesh2)
|
||||||
|
|
||||||
point.position.set(world_position.x, p * 3, world_position.z * 2)
|
point.position.set(world_position.x, p * 3, world_position.z * 2)
|
||||||
point.name = `${element.id}_clickable`
|
point.name = `${element.id}_clickable`
|
||||||
point.updateMatrixWorld()
|
point.updateMatrixWorld()
|
||||||
|
@ -298,6 +312,7 @@ onAfterRender(() => {
|
||||||
clickable_refs.value.map(el => {
|
clickable_refs.value.map(el => {
|
||||||
if (el.value[0] && el.value[0].children) {
|
if (el.value[0] && el.value[0].children) {
|
||||||
el.value[0].children[0].lookAt(camera.value?.position)
|
el.value[0].children[0].lookAt(camera.value?.position)
|
||||||
|
el.value[0].children[1].lookAt(camera.value?.position)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (controls.value) {
|
if (controls.value) {
|
||||||
|
@ -365,7 +380,6 @@ const clickEvent = (event: MouseEvent) => {
|
||||||
|
|
||||||
const clickable_objects = seekAllByName(scene.value, '_clickable');
|
const clickable_objects = seekAllByName(scene.value, '_clickable');
|
||||||
const intersects = raycaster.value.intersectObjects(clickable_objects);
|
const intersects = raycaster.value.intersectObjects(clickable_objects);
|
||||||
// const intersects_visible = intersects.filter(el=>el.visi)
|
|
||||||
const names = intersects
|
const names = intersects
|
||||||
.map(el => (el.object.parent ? el.object.parent.name : el.object.name) ?? false)
|
.map(el => (el.object.parent ? el.object.parent.name : el.object.name) ?? false)
|
||||||
.filter(el =>
|
.filter(el =>
|
||||||
|
|
Loading…
Reference in New Issue