In search of a unique setting, I envision a universe where the gaps between meshes represent incredibly large numbers (for instance 10^15). Despite this vast distance, there is one mesh whose position (x, y, or z) quivers unsettlingly. Even after experimenting with the logarithmicDepthBuffer
, the issue persists.
I find myself unable to diminish the distances as some meshes are separated by 1000 km while others span an incredible 1,000,000 light years. Is there a solution to address this anomaly? Feel free to view the example provided.
<html>
<head>
<script src="https://threejs.org/build/three.js"></script>
</head>
<body>
<script>
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
var renderer = new THREE.WebGLRenderer({
logarithmicDepthBuffer: true
});
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
var geometry = new THREE.BoxGeometry(1, 1, 1);
var material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
var cube = new THREE.Mesh(geometry, material);
cube.position.x = Math.pow(10, 15) // Very large position x.
cube.add(camera)
scene.add(cube);
camera.position.z = 3;
function animate() {
requestAnimationFrame(animate);
renderer.render(scene, camera);
cube.rotation.y += 0.01;
}
animate();
</script>
</body>
</html>