I have a floating plane in three js. It's double sided and my camera moves and rotates about the scene. My question is, given the position and rotation of the plane and position and rotation of the camera, how can I tell which side of the plane I am looking at?
My old solution is this (check the distance from camera to front and back of the plane) but obviously this isn't the best solution.
this.back.matrixWorldNeedsUpdate = true;
this.front.matrixWorldNeedsUpdate = true;
this.d1 = (new THREE.Vector3()).getPositionFromMatrix( this.back.matrixWorld ).distanceTo(cameraSystem.camera.position);
this.d2 = (new THREE.Vector3()).getPositionFromMatrix( this.front.matrixWorld ).distanceTo(cameraSystem.camera.position);
if((this.d1 - this.d2) < 0)'Facing the back Side'
else 'Facing the front Side'
Thanks!
Great, Thanks to George and three.js set and read camera look vector, this code works