I am working with matrixes.
I really badly need them to become more efficient with the cpu.
The main method to achieve that. Appears to be merge.
Which is explained in Learn 3js, 3rd edition, page 269.
The code is the following:
var geometry=new THREE.Geometry();
for(var line=0; line<100; line++){
var mesh=new THREE.Mesh();
mesh.updateMatrix();
geometry.merge(mesh.geometry, mesh.matrix);
}
But when I run this code, I get error:
THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.
In the original code there is function addcube(), instead of new THREE.Mesh().
But then author says later in on the page that it’s just new Mesh.
Can anybody see why this error is?
Here’s my code sample, by the way:
https://openage.org/it/3d/
buttons are wasdeq, 1, 2 and z.
I figure with merge I can make much bigger landscape matrixes.