I tried to implement a function to select and move objects in a stage compound of an orthographic camera.
I'd like to get the same example as : http://threejs.org/examples/webgl_interactive_draggablecubes.html
but not with perspective camera.
I already replaced :
var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 1000 );
with :
var camera = new THREE.OrthographicCamera(window.innerWidth / -zoom, window.innerWidth / zoom, window.innerHeight / zoom, window.innerHeight / -zoom, -1000, 1000);
and replaced this :
var ray = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
by this :
var ray = projector.pickingRay( vector, camera );
But, it does not seem to be enough to run.
So, what's it lack ?
Is it possible to use Projector and Ray with OrthographicCamera ??
Thanks.
In April 2022, the following works for me to detect clicks when using an orthographic camera.
Orthographic camera:
Click handler: