0

I have been attempting to correct an issue when rendering my three.js program onto google chrome.
It creates the scene, but all objects are rendered black.
The program works correctly on firefox, but since updating to the latest build of three.min.js, 1 in 5 times, all objects are rendered black.
I have managed to debug my code so far using firefox terminal. However the final error I have encountered, is the following.

"THREE.Projector has been moved to /examples/js/renderers/Projector.js."

From this I understand the issue is with the projector. Which I declare as

projector = new t.Projector();

Later I use for the following -

var mouseVector = new t.Vector3(
        ( e.clientX / WIDTH ) * 2 - 1,
      - ( e.clientY / HEIGHT ) * 2 + 1,
        1 );

    projector.unprojectVector( mouseVector, cam );

Also

pointerDetectRay = projector.pickingRay(mouse2D.clone(), cam);          
        var intersects = pointerDetectRay.intersectObjects(scenemodels.children);

Do I need to completely remove all instances of the projector and replace it with something? If so what with? Or is the error related to something else?

AMorton1989
  • 313
  • 1
  • 6
  • 30

2 Answers2

4

THREE.Projector used to be part of the three.js library but know it is external. So you just need to include it as a script.

<script src="location-of-your-threejs-library-download/examples/js/renderers/Projector.js"></script>
gaitat
  • 12,449
  • 4
  • 52
  • 76
2

Projector's functionality can now be achieved using Raycaster.

There is a good discussion on it in this question: Three.js Projector and Ray objects

Community
  • 1
  • 1
mijiturka
  • 434
  • 6
  • 18