A guide to projecting an image onto a curved surface in three.js

I decided to create a complete sphere using sphere tiles, allowing me to manipulate each tile individually when they are within the FOV.

To achieve this, I broke down an equirectangular panorama into various square images in order to place them onto the tiles. However, there seems to be an issue with the texture alignment on the top and bottom rows of segments within each tile.

Here is an example showcasing some imported square images:

The original test image:

How can I ensure that the textures align correctly on the tiles? Below is the code used to generate the tiles:

/*
    segment Data:
    x/y are generated by a loop
    maxX/maxY are the maximum values of these loops
*/
sphere = new THREE.SphereGeometry(radius, 4, 4, segmentData.x * 2 * Math.PI / segmentData.maxX, 2 * Math.PI / segmentData.maxX, segmentData.y * Math.PI / segmentData.maxY, Math.PI / segmentData.maxY);
texture = new THREE.TextureLoader().load(tileImagePath);
material = new THREE.MeshBasicMaterial({map: texture});
mesh = new THREE.Mesh(sphere, material);
scene.add(mesh);

As I am new to three.js, I suspect this may be a simple problem. Can someone please provide assistance?

Any help would be greatly appreciated. Thank you!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Implementing a fetch request in React-Native and handling the returned

Currently, I am facing an issue in the renderImage() function where I need to return a piece of code, but it is not working as expected. Despite trying out different solutions, I am unsure of what else to do at this point. The error that I am encountering ...

Placing one image over another to create a layered effect

I'm having some difficulty overlaying a logo on top of a background image. In my HTML code, the background image is continuously refreshed to appear like a video stream. The image, dublin-rememberance-floor2, is retrieved from a database using JavaScr ...

The Django project does not contain any JS script

Currently expanding my knowledge in Django and encountering an issue. The JS script is not being included in the Django project despite having the correct path. While the page itself with the graph block functions properly, the output of a round or bar cha ...

Updating the Navbar in React Routing does not happen automatically, but it does refresh when the page is refreshed

Currently, I am using vanilla React with React-Router for my project. One of the issues I am facing is detecting whether a user on the page has a token, indicating their logged-in status. While setting up routes for Login/Register/Logout functionalities, ...

Utilizing a switch statement in Jquery to target specific input elements for focus

My Objective As a user presses enter, I want to target specific input elements with a data-index attribute value between 0-2 and of type text. Then, I plan to check their attribute values using a switch statement to perform certain actions. Presented bel ...

Trigger audio files in the array at a 0.5-second interval

Currently, I am in the process of developing a Simon game, but I have encountered a roadblock that I am struggling to overcome. My main challenge lies in handling the array with the currentSequence that holds random sounds from another array. I have establ ...

Wordpress Ajax Login Issues - Error Code 302

I am currently working on implementing a basic Ajax Login system using Wordpress. However, I have encountered an issue where my system fails every time the "wp_signon" function is triggered, and the only feedback I receive is as follows: POST myurl/wp-adm ...

Substitute the functions within a Node.js module with simulated functions

I am currently working on a Node.js project that serves as an API wrapper. To ensure the reliability of my code, I am writing unit tests using nodeunit and need to incorporate mock functions into the module. For instance, I require a function that mimics s ...

Exploring the world of jQuery animation and background colors with Animate()

I'm currently attempting to implement a basic pulse effect by utilizing JQuery to modify the background color. However, I am facing issues with animating the backgroundColor property. function show_user(dnid) { /* dnid represents the HTML ID of a ...

The dilemma of maintaining order with an async loop nested within a promise

Prior to displaying the page, it is crucial that all data fetched from the API call is stored in the database. let saveUsersToDB = function () { // Function to fetch users return getAllUsers.then((data) => { // Function ...

RetrieveByUserIdentifier as a callback method (express)

Can you help me refactor the code below to use a callback function instead? I want to ensure that the Req and Res logic is handled separately. Userservice.js function getByUserId(req, res, next) { let userIDD = req.body.userID; User.findOne({ use ...

The validation message from the requiredfieldvalidator is persisting even after filling the textbox with javascript

Is the textbox empty or not when using RequiredFieldValidator? When clicking the submit button, an error message appears but if the textbox is filled using javascript and then clicked elsewhere, the error message does not disappear. However, if something ...

Verify if the specified value is present in the dropdown using AngularJS

Utilizing AngularJS, I have implemented an input field with autocomplete functionality. The autocomplete feature pulls data from a JSON file and displays it in a dropdown table format. Users are able to filter the results and select a value from the dropdo ...

What is the best method for directing a search URL with an embedded query string?

Currently, I am developing an express application that has two different GET URLs. The first URL retrieves all resources from the database but is protected by authentication and requires admin access. The second URL fetches resources based on a search para ...

Three JS and the Mystery of the Disappearing LOD DAE Object

I am currently experimenting with the THREE.LOD object in my ThreeJS scene, taking inspiration from the example at However, I wanted to expand on this idea by incorporating a DAE model (using the loader provided here: ) The issue lies in my inability to ...

substitute a component with a different one if it is present

I'm currently working on a script that will automatically replace one element with another as soon as it is created, even when the page loads. Despite my attempts to use MutationObserver, I haven't been successful. var target = document.querySe ...

The REST API from React encountered a Cors-related error in the cloudinary response during the upload process

I am attempting to upload an image through a direct REST API call using the following code snippet. The code works perfectly fine from my personal computer (localhost:3000). const cloudinaryUrl = 'https://api.cloudinary.com/v1_1/{my_id}/image/upload&a ...

How is it possible that both of my AngularJS services are being directed to the exact same Restful Java EE web service?

I am facing an issue with my two angularjs services. One is supposed to retrieve a single user while the other should return an array of users. However, both seem to be calling the service that returns an array of users. Can you help me understand why this ...

Using JQuery to compare duplicate values within the same input name

I am dealing with several hidden input fields like the ones below: <input type="hidden" value="4531" name="product_id"> <input type="hidden" value="4532" name="product_id"> <input type="hidden" value="4533" name="product_id"> My goal is ...

Tips for modifying CSS when a user scrolls beyond a specific div

Currently, I am working on implementing a scroll function that dynamically moves elements based on the user's scrolling behavior. The code I have written works to some extent and successfully moves the elements. However, my goal is to create a list o ...