My current project involves creating a plane at z = 0 with infinite x and y dimensions.
The next step is to generate a ray from the mouse position and determine where it intersects.
I am uncertain about the process of constructing this plane and whether it is the most optimal approach.
It's important to note that this scenario takes place in a 2D scene with everything lying on the z = 0 plane.
var projector = new THREE.Projector();
var mouse_vector = new THREE.Vector3();
var mouse = { x: 0, y: 0, z: 1 };
ray = new THREE.Raycaster( new THREE.Vector3(0,0,0), new THREE.Vector3(0,0,0) ),
var intersects = [];
event_info.preventDefault();
mouse.x = ( event_info.clientX / window.innerWidth ) * 2 – 1;
mouse.y = – ( event_info.clientY / window.innerHeight ) * 2 + 1;
mouse_vector.set( mouse.x, mouse.y, mouse.z );
projector.unprojectVector( mouse_vector, camera );
var direction = mouse_vector.sub( camera.position ).normalize();
ray = ray.set( camera.position, direction );
var plane = new THREE.Plane();
plane.set(v1, v2, v3);
var where = ray.intersectPlane (plane);
intersects = ray.intersectPlane( Plane );
alert(intersects);
}