javascript - How to create a cube formed by 600 000 000 mini-cubes per side with ThreeJs? -


i recreate cube in game curiosity what's inside cube? formed 600 000 000 mini-cubes per side. can't use texture simulate mini-cubes because there must visual change on mini-cube when click on it.

i tried boxgeometry() object 2 faces mini-cube

    var scene = new three.scene();     var camera = new three.perspectivecamera(75, window.innerwidth / window.innerheight, 0.1, 1000);     var renderer = new three.webglrenderer({         alpha: true     });     renderer.setsize(window.innerwidth, window.innerheight);     document.body.appendchild(renderer.domelement);      //there cube     var geometry = new three.boxgeometry(20, 20, 20, 24494, 24494, 24494);     var material = new three.meshbasicmaterial({         color: 0xfd59d7     });      var cube = new three.mesh(geometry, material);     scene.add(cube);      camera.position.z = 100;      render();      function render() {         renderer.render(scene, camera);     } 

so how create cube 600 000 000 mini-cubes per side rendered on notebook?

i can guarantee curiosity not display cube made 600,000,000 cubes per side. no current gpu can draw 600,000,000 cubes @ smooth framerate. pointed out above that's 7.2 billion triangles per side. can see 3 faces of cube @ once @ 30fps 648 billion triangles per second. nvidia 1080 gt (a near top performance card in 2017) can draw theoretical 11 billion triangles per second , that's theoretical. in reality never reach speed.

at best in curiosity, when can see entire cube displays single 12 polygon cube textures pixel represents more 1 cube (if there 600,000,000 cubes per side) require texture of 24494x24494. that's 5x 10x phone can display in single texture. yes subdivide face of cube smaller polygons each using different texture. require 2.3gig of textures per side or 13.4gig of memory entire cube. phones don't have 13.4 gig of memory.

if 600 million cubes per side best google maps data stored on server , various representations streamed user. when user zoomed out see entire cube representation of 1024x1024 per side (1 million pixels) shown , zoom in different representations showing smaller portion of cube downloaded , shown.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -