Moving the camera model will shake if the coordinates are large
var position = new THREE.Vector3( 1000000, 0, - 100000 );
Geometry coordinates are large, model will shake
var box = new THREE.BoxBufferGeometry( 5, 5, 5 );
box.translate( position.x, 0, position.z );
var mesh = new THREE.Mesh( box );
scene.add( mesh );
But it’s ok, if you move the coordinates of the Mesh
var box = new THREE.BoxBufferGeometry( 5, 5, 5 );
var mesh = new THREE.Mesh( box );
mesh.position.x = position.x;
mesh.position.z = position.z;
scene.add( mesh );
I feel like only the modelViewMatrix is different.
My application needs to generate geometry on a large number of coordinates, and the origin of the model is keep at 0,0,0
I do a gis big data visualization, I use InstancedBufferAttribute to generate a lot of coordinate points, InstancedBuffer is a very important optimization
I don’t think this information is relevant to your problem. You have to ensure that your camera is centered around the origin and avoids large values like 1000000. When moving around in space, you should try to translate the world instead of the camera. Or you try to work with relative coordinates like mentioned here. Both are best practises for large open-world games or planetary applications. Also try to work in a lower scale which will also mitigate floating point precision issues.
I think the stuttering of your example from github happens because of the camera position. However, even if your camera is at the origin you need a large view frustum in order to see objects that far away. This will lead to depth precision issue which can be mitigated by using a logarithmic depth buffer. The following example shows how you can use this technique in your app: