While working on a WebGL project using the excellent Sim.js and Three.js libraries, I came across the following problem:
Somewhere along the way, he uses the following constructor for THREE.Ray:
var ray = new THREE.Ray( this.camera.position, vector.subSelf( this.camera.position ).normalize() );
where vector is Vector3,
which causes the following error:
The TypeError object [object object] does not have a subSelf method.
I checked the documentation from the Three.js file that I am using and the method on vector3 which is most suitable for this,
.sub( v ) Vector3
I tried to change this, and a new error appears on this call:
var intersects = ray.intersectScene( this.scene );
which throws an error again, because when I check, the ray has no intersectsPlane method
maxandonuts
source share