I have got a ray and a plane. The ray is intersecting the plane and I would like to know where. How do I get the world-coordinates of this intersetion?
(My particular case I unproject screen-coordinates to the camera and create the ray. The plane is the ground of the scene)
var vector = new THREE.Vector3( mousePosition.x, mousePosition.y, 1 );
projector.unprojectVector( vector, camera );
var ray = new THREE.Ray(
camera.position,
vector.subSelf( camera.position ).normalize()
);
This is the usual pattern. You may have to adapt it to fit your particular situation.
Here,
objectsis an array. For example,EDIT: Updated for three.js r.84