I’ve just add some markers on globe, and it would show its name when mouseover.
As you can see, the LA behind globe, it should be non-interactive except that the markers in front of the globe, but I can still click the marker LA.
In this case, is there any good solution, hide the marker or prevent mouse pass through the globe? I have no idea how to implement by code, any help would be appreciated.
Here is my code:
var material = new THREE.PointsMaterial({
color: 0xFFFFFF,
size: 20,
transparent: true,
blending: THREE.AdditiveBlending,
map: createPoint(), //use canvas texture
depthWrite: false
});
function createPoint() {
var canvas = document.createElement("canvas");
canvas.width = 16;
canvas.height = 16;
var context = canvas.getContext("2d");
var gradient = context.createRadialGradient(canvas.width / 2, canvas.height / 2, 0, canvas.width / 2,
canvas.height / 2, canvas.width / 2);
gradient.addColorStop(0, 'rgba(255,255,255,1)');
gradient.addColorStop(0.2, 'rgba(0,255,255,1)');
gradient.addColorStop(0.4, 'rgba(0,0,64,1)');
gradient.addColorStop(1, 'rgba(0,0,0,1)');
context.fillStyle = gradient;
context.fillRect(0, 0, canvas.width, canvas.height);
var texture = new THREE.Texture(canvas);
texture.needsUpdate = true;
return texture;
}