three.interaction.js
three.interaction.js copied to clipboard
Property 'on' does not exist on type 'Mesh'
I'm not able to use this lib in Angular2. I keep getting this error: Property 'on' does not exist on type 'Mesh' My code: var interaction = new Interaction(this.renderer, this.scene, this.camera) var cube = new THREE.Mesh( new THREE.BoxGeometry(3, 3, 3), new THREE.MeshPhongMaterial({ color: 0xffffff }) ); this.scene.add(cube); cube.on('pointerdown', function(ev) { console.log('pointerdown'); });
can you tell me the version of three.js
you can update your three.js to last version
I already have the latest version of Three.js As far as I can't tell it doesn't import correctly as an angular module (threejs seems to be working correctly)
how do you use it ? can you show me the whole code. i had test this lib on [email protected] right now.
I had the same problem (three 0.103.0), and I didn't find any other solutions than to use //@ts-ignore
I don't think this library is intended to be used in typescript
I have the same problem with in react ^16.8.6 and threejs r110 @jasonChen1982
I have the same problem with in react ^16.8.6 and threejs r110 @jasonChen1982
I solved my question. https://github.com/jasonChen1982/three.interaction.js/issues/17
I have the same problem within react ^16.8.6 and threejs r110 @jasonChen1982
I solved my question. #17
yes, because three.interaction
import and add some patch for three
, please ensure we import same three bundle
import * as THREE from 'three';