intersectPlane bug
Hi guys
I have come across a bug with intersect plane I think. The intersection point is incorrect when in orthographic mode, but fine otherwise. ( camera is a CombinedCamera )
plane = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3(0, 0, -1 ), pos );
var camera = viewport.camera;
var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
this.projector.pickingRay( vector, camera );
var ray = new THREE.Ray( camera.position, vector.subSelf( camera.position ).normalize() );
var intersects = ray.intersectPlane( plane, intersectsPoint );
Perhaps im misunderstanding something...?
Orthographic picking rays do not go through the origin (camera.position) because they are parallel to each other. Thus it is an error in your code above.
See related issue #2453.
Also, CombinedCamera does not have a position property. This has lead to some user confusion, BTW.
ah... damned CombinedCamera...
Cheers guys, I actually had a feeling it might be something to do with that. Out of curiosity though, how then would you position an object from say a left orthographic view? What I am currently doing, is whenever you click on an object a gizmo is added to the scene which allows you to translate said object. When you click down on one of the axes it creates a plane at the objects location and its normal faces the camera. The ray is fired from the mouse position and I am able to test for the intersection with the plane I am translating on. But how would I do it in orthographic view if the above is true?
Thanks for any help guys Mat
Actually scratch that - i've managed to sort it out. Thanks guys.