I have a 3D sphere that I am looking to map an array of images onto. I want to be able to control each image independently, allowing for fading in and out of each image. To better illustrate my goal, I will provide an example image of what I am trying to achieve.
https://i.sstatic.net/25olS.jpg
As shown in the example above, there are 8 images per column and approximately 16 per row.
I have managed to replicate the image above by simply mapping it to a SphereGeometry
. However, I desire the ability to dynamically swap out images and fade them in at different intervals.
My Approach and Ideas:
One approach I tried was pushing 8 test images to an array and using it as the material map. Then, I looped through each face of the
SphereGeometry
and assigned a material index ranging from 1 to 8. However, this method did not yield the desired results:function createGlobe() { var geomGlobe = new THREE.SphereGeometry(40, 32, 16); var l = geomGlobe.faces.length; imageArray.push(new THREE.MeshBasicMaterial({map: texture1})); imageArray.push(new THREE.MeshBasicMaterial({map: texture2})); ... imageArray.push(new THREE.MeshBasicMaterial({map: texture8})); for (var i = 0; i < l; i++) { geomGlobe.faces[i].materialIndex = i % 8; } Globe = new THREE.Mesh(geomGlobe, imageArray); scene.add(Globe); }
I suspect that I need to group every 4 or 8 faces and assign the same material index to each one in the group to use the same image. However, I am unsure if the faces align correctly in this manner.
Overall Requirement:
I am seeking a solution to dynamically incorporate images onto a sphere in an 8 per column, 16 per row layout, with the capability to manipulate each image independently.
Any assistance would be greatly appreciated as I am currently facing a roadblock!