I tried to do the same when I saw this model. Since I tried to do it the same way and could not understand, I will offer an alternative.
var line; function update() { // Z- DIRECTION raycaster.ray.direction.set(0, 0, -1); var geometry = new THREE.Geometry(); intersections = raycaster.intersectObjects( objects ); if ( intersections.length > 0 ) { var geometry = new THREE.Geometry(); // POSITION OF MESH TO SHOOT RAYS OUT OF geometry.vertices.push( obj.position ); geometry.vertices.push( intersections[0].point ); scene.remove(line); line = new THREE.Line(geometry, new THREE.LineBasicMaterial({color: 0x990000})); scene.add(line); } }
So now you have a line firing from your grid at any nearest intersection.
https://dl.dropbox.com/u/42766757/guy.png
source share