Hi,
I was made a line.
after then, update line vertices position
MakeLine(){
let lineGeometry = new THREE.Geometry();
lineGeometry.vertices.push(new THREE.Vector3( Firstposition.x , Firstposition.y , Firstposition.z) );
lineGeometry.vertices.push(new THREE.Vector3( Secposition.x , Secposition.y , Secposition.z) );
let lineMaterial = new THREE.LineBasicMaterial( { color : 0x00a12b });
let LineObject = new THREE.Line(lineGeometry, lineMaterial);
three.scene.add(LineObject);
}
UpdateLineVertices() {
MissionDatasLine.forEach(function(models){
models.geometry.vertices[0] = (0 , 0, 0);
models.geometry.vertices[1] = (0 , 0, 10);
models.geometry.verticesNeedUpdate = true;
});
}
function ClickObjects() {
three.camera.updateProjectionMatrix();
raycaster.setFromCamera( mouse, three.camera ); // calculate objects intersecting the picking ray
var intersects = raycaster.intersectObjects( three.scene.children, true );
}
Step 1 : MakeLine(); …is OK
Step 2 : UpdateLineVertices(); …is OK
Step 3 : ClickObejcts(); …is Not OK
When I do ‘Step 3’ , get Error …
What is the problem in this code?
Thank you !