UNPKG

@youyouzone/threejs-mouse-effect

Version:

<p align="center"> <img src="./screenshot/profile.gif" alt=''> </p>

40 lines (31 loc) 1.09 kB
<p align="center"> <img src="./screenshot/profile.gif" alt=''> </p> # Threejs-Mouse-Effect Mouse effect based on Threejs. ## Installation ```bash npm install @youyouzone/threejs-mouse-effect ``` ## Usage ```js import MouseEffect from '@youyouzone/threejs-mouse-effect'; // setup const mouseEffect = new MouseEffect(scene, canvas, camera, options); // dispose mouseEffect.dispose(); ``` Props: * scene: Scene - threejs scene. * canvas: HtmlCanvasElement - canvas element. * camera: Camera - threejs camera. * options?: { isAnimate?: enable animation, default value is true, hoverColor?: set color when hover on a object, default value is 'dodgerblue', } ## License This project is licensed under [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ## Contact * Email:[eric199002@icloud.com](eric199002@icloud.com) * Twitter:[https://twitter.com/nikoniko600](https://twitter.com/nikoniko600) * Repo:[https://github.com/Eric-Schecter/threejs-mouse-effect](https://github.com/Eric-Schecter/threejs-mouse-effect)