Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpriteText2D not recognizable with raycast #8

Open
spaceunlimited opened this issue Jun 2, 2016 · 1 comment
Open

SpriteText2D not recognizable with raycast #8

spaceunlimited opened this issue Jun 2, 2016 · 1 comment

Comments

@spaceunlimited
Copy link

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?

@gino8080
Copy link

yeah same here , can't click on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants