Sprite can not use useScreenCoordinates

Description of the problem
var sprite = new THREE.Sprite(new THREE.SpriteMaterial{
    map : texture,
    useScreenCoordinates : true //now on r81 this attribute had removed..
});

When i want to create a sprite that can follow my mouse, how can i do??
there is no “useScreenCoordinates” can be used..

Three.js version
  • Dev
  • [√] r81
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “Sprite can not use useScreenCoordinates

  1. The idea is that you create a second orthographic camera, and use this one to overlay the sprites; you can find the example here.

    The gist of the code is in the render loop, after setting renderer.autoClear to false:

    renderer.clear();
    renderer.render( scene, camera );
    renderer.clearDepth();
    renderer.render( sceneOrtho, cameraOrtho );

Comments are closed.