three-text2d icon indicating copy to clipboard operation
three-text2d copied to clipboard

SpriteText2D not recognizable with raycast

Open spaceunlimited opened this issue 9 years ago • 1 comments

Hey, is there a way to get the SpriteText2D class elements recognized by a raycast?

I tried pushing my SpriteText2D object into the object which should intersect. All THREE.Geometry objects I push into "objects" before get me intersections but the Text2D.

sprite = new SpriteText2D("Headline "+i, { align: textAlign.center, font: '20px Arial', fillStyle: '#970F6B', antialias: true, strokeStyle: '#000000'})
                    sprite.position.set(particle.position.x+20, particle.position.y+30, particle.position.z+20)
                    sprite.scale.set(1, 1, 1)
                    sprite.material.alphaTest = .1
                    scene.add(sprite);
                    objects.push( sprite );


var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {

                    if ( INTERSECTED != intersects[ 0 ].object ) {
                        console.log(intersects[ 0 ].object);
                    }

Any idea why they are not hit?

spaceunlimited avatar Jun 02 '16 09:06 spaceunlimited

yeah same here , can't click on it

gino8080 avatar Feb 13 '20 10:02 gino8080