three.interaction
a full-interaction event manager, help three.js
binding interaction event more simple
install
npm install -S three.interaction
usage
;; const renderer = canvas: canvasElement ;const scene = ;const camera = 60 width / height 01 100; // new a interaction, then you can add interaction-event with your free styleconst interaction = renderer scene camera; const cube = 1 1 1 color: 0xffffff ;scene;cubecursor = 'pointer';cube;cube;cube;cube;cube;cube;cube;cube;cube;cube;// and so on ... /** * you can also listen on parent-node or any display-tree node, * source event will bubble up along with display-tree. * you can stop the bubble-up by invoke ev.stopPropagation function. */scenescene