Ray not seeing Face covering Screen #1935

noiv opened this Issue May 17, 2012 · 6 comments


2 participants

noiv commented May 17, 2012

I have a sphere ( THREE.SphereGeometry(RADPLANET, 32, 16, Math.PI/2*3); ) centered at (0,0,0) having y axis through the poles. Now I place PerspectiveCamera at (0,30000,0) looking at (0,0,0) and onmousemove calulates this vector:

    vecMouse.x =   (event.clientX / winWidth ) * 2 - 1;
    vecMouse.y = - ((event.clientY)/ (winHeight)) * 2 + 1;

Then in the render function:

    var vector = new THREE.Vector3( vecMouse.x, vecMouse.y, 0.5 );
    projector.unprojectVector( vector, camera );
    var ray = new THREE.Ray( camera.position, vector.subSelf( camera.position ).normalize() );
    var intersects = ray.intersectObject(meshPlanet);


The screenshot shows the mousepointer at the border where the ray is getting blind. Any position inside a circle of ~10° around the pole is not detected (intersects = empty), same happens at South Pole. What I want to achieve is that the user can select the colored boxes to get further information, which works really good everywhere else.

What can I improve?


mrdoob commented May 18, 2012

Do you mind creating a working jsfiddle that shows the issue?

noiv commented May 19, 2012

Sure, is there a template I can fork?


mrdoob commented May 19, 2012

Hold on. Let me write one for you.

noiv commented May 20, 2012

Have a working fiddle http://jsfiddle.net/noiv/4s7p4/ . Going back to code and check differences...

@mrdoob mrdoob closed this May 23, 2012

noiv commented May 25, 2012

Was mixture of sources of different versions :(

Thanks, for the template!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment