Hi everyone! I made a table and it looks like this:
Table simple made from planes which I created from my own method createPlane
createPlane(data) {
let geometry = new THREE.PlaneGeometry( 1, 1 );
let material = new THREE.MeshLambertMaterial( {color: new THREE.Color(data.color), side: THREE.DoubleSide} );
let plane = new THREE.Mesh( geometry, material)
plane.scale.set(data.width, data.height, 1)
scene.add(plane)
}
I was looking for information about how to create boundary in three.js documentation. Found OutlinePass in post-processing and EdgesGeometry.
I tried to use EdgesGeometry. Method where I used EdgesGeometry to create boundaries of plane:
addEdgeBorder(mesh) {
const edges = new EdgesGeometry( mesh.geometry );
const line = new LineSegments( edges, new LineBasicMaterial( { color: 0x000000 } ) );
mesh.add(line)
}
The table began to look like this:
I liked this result, but I had a problem with raycaster, since now only the boundaries of the plane are highlighted, but not the plane itself.
What am I doing wrong? I need to select only planes. How can this be fixed? Can I somehow force to ignore raycaster boundaries? I spent a lot of time on this case and I haven’t any idea to solve it…