controller.js 474 B

1234567891011121314151617181920
  1. this.triggerdown = function(){
  2. this.pointer.material.color = "black";
  3. this.penDown = true;
  4. }
  5. this.triggerup = function(){
  6. this.pointer.material.color = "white";
  7. this.penDown = false;
  8. }
  9. this.onMove = function(){
  10. if(this.penDown){
  11. let scene = this.getScene();
  12. let pos = this.pointer.worldPosition();
  13. let path = scene.drawNode.linepath.path.slice();
  14. path.push(pos);
  15. scene.drawNode.linepath.path = path;
  16. }
  17. }