Dragging is disrupted by text overlays in Three.js

After following the recommendations on GitHub (https://github.com/mrdoob/three.js/issues/1321) and also here on StackOverflow (Dynamically create 2D text in three.js), I decided to overlay text using HTML divs.

However, a problem arises when the user rotates the scene and the cursor crosses over any of the divs, causing the drag action to stop. Even when the cursor moves past the text div, the drag action doesn't resume, leading to an abrupt halt in movement that can only be fixed by releasing and clicking the mouse again.

You can see this issue in action on this page:

I am currently using the standard OrbitControls.js with

controls = new THREE.OrbitControls(camera, renderer.domElement);

I've attempted various solutions:

(1) Trying to detect the mouseout event from the div and setting controls.enabled true, but it didn't work. Toggling controls.enabled = false does disable controls, but I couldn't get them to reactivate on mouseout.

(2) Simulating a mouseup (while over the div) followed by a mousedown on mouseout did not solve the issue either.

(3) I also experimented with hiding the div on mouseover, but this proved ineffective as well since the dragging motion had already stopped by then.

(4) Disabling text highlighting within the divs did not make a difference.

Is there a way to restart the drag motion after passing over a div? If so, how can this be achieved?

Thank you for your help.

Answer №1

Apply the CSS property pointer-events: none to the labels for improved functionality.

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

The button on an AJAX submission page is unresponsive when attempting to click it

I am currently working on a commenting project where I have a button with the id #see_more_comments inside the .user__comments__container div. This content is being generated from a getcomments-afunc.php file using jQuery post when the comment count exceed ...

When attempting a REST API call to get a user in a group using the "getbyemail" method, an error is returned stating "Resource for the request getbytitle cannot

Individuals are part of the sharepoint group: https://i.sstatic.net/NcwU8.png When attempting a simple GET request in the browser: https://mycompany.sharepoint.com/sites/testsite2/_api/web/sitegroups/getbytitle('TestGroup')/users/getbyemail(&apo ...

Tips for utilizing node transformation to convert an object into a different form

As someone new to Node streams, I'm currently experimenting with them and facing unexpected issues. My goal is to create a simple transform for practice. interface MyTransformStreamOptions { [key: string]: any } class MyTransformStream extends Tra ...

The THREE.TextureLoader() function will repeatedly load a single texture, potentially more than 20 times

An issue has been discovered with the THREE.TextureLoader() function, as it seems to load the same assets multiple times (often 20 times or more) in an unexpected and erroneous manner. The screenshot below from the browser console illustrates this behavio ...

Automatically sort with Angular and PHP

Currently, I am in the process of getting a search function to work smoothly. It involves loading data from a database using PHP to Angular, and everything seems to be displaying correctly prefilled, with one exception. There is a select option where the ...

Display thumbnail images in jquery-ui dropdown menu

Hello, I'm looking to display a small image (the user's thumbnail) on the jquery-ui dropdown by making an ajax call. As someone new to ajax and unfamiliar with jquery-ui, I would appreciate some guidance in the right direction. Thank you! HTML/J ...

Linking the value of an expression to ngModel

There is a specific scenario where I need the ng-model property to bind to a value retrieved from the database as part of the business logic. To illustrate this concept, I have set up an example function TodoCtrl($scope) { $scope.field1 = "PropertyFr ...

The functionality of Angular binding seems to be experiencing some issues

Just starting out with angular and trying to figure things out. I've made an HTML page where the user can input text into a textbox, and whatever is entered should simultaneously appear on the screen. Here is the HTML code snippet: <html ng-app&g ...

rectangle/positionOffset/position().top/any type of element returning a position value of 0 within the container

While the height/position of the container is accurately displayed, attempting to retrieve the top position (or any position) of containing elements yields a return value of 0. Additionally, using .getBoundingClientRect() results in all values (top, left, ...

Calculating the total price of items in a shopping cart by multiplying them with the quantity in Vue.js

I am currently working on enhancing the cart system in Vue.js, with a focus on displaying the total sum of product prices calculated by multiplying the price with the quantity. In my previous experience working with PHP, I achieved this calculation using ...

Searching for nested objects using dynamically generated property names

I am currently facing a challenge with accessing nested objects in MongoDb using the Node.js Driver, particularly when dealing with dynamic property names. Below is an example of my dilemma: //Although this code gives the desired results, it lacks dynamic ...

Systemjs running with Angular2 is causing 503 errors

I have developed a basic Angular2 app that does not make any external calls to resources. It consists of approximately 10 components, each with its own HTML and CSS files. I utilize gulp to generate a distribution package and deploy it to a testing environ ...

Attach a click event to a dynamically generated element inside a directive

After thinking I had successfully solved this issue, it turns out I was mistaken. I developed a directive to enable me to clear a text input field. Essentially, when you begin typing into the input box, an "X" icon appears on the right side of the textbox. ...

How can I display the value of a radio button that has been chosen?

Would you mind sharing how to display the selected value of a radio button? I attempted it this way, but unfortunately, it did not work. You can view my code at this link. <mat-radio-group [(ngModel)]="favoriteName"> <mat-radio-button *ngFor="l ...

What is the best way to calculate the product of decimal numbers within a TypeScript Number variable?

Imagine you have a number, for example 288.65, and you want to multiply it without the decimal point in order to obtain the result of 28865. However, when attempting to achieve this by using console.log(288.65 * 100), the output is not as expected, showin ...

What is the best way to include a context in a JavaScript promise?

Figuring out JS Promises has always been a challenge for me. I'm aware this might be a basic question, but please bear with me. =) Looking at the code snippet below, my goal is to modify a property within the class containing this function (essentiall ...

Using webpack to access a bundled React class in an HTML file

Is there a way to access pre-built components directly within the HTML file that links to the build? I've been attempting the following - Inside bundle.js var React = require('react'); var ReactDOM = require('react-dom'); ...

Customizing Material UI tooltip styles with inline CSS formatting

Currently in the process of creating a React component that utilizes the Material UI Tooltip feature. In my component, I have the need to manually reposition the Mui Tooltip by targeting the root popper element (MuiTooltip-popper). However, the Mui Toolti ...

Automatically close the multiselect dropdown when the user interacts outside of it (varied scenario)

For those interested, check out this jsfiddle link: http://jsfiddle.net/jaredwilli/vUSPu/ This specific code snippet focuses on creating a multi-select dropdown feature. When a user chooses options from the dropdown and then clicks outside of the menu are ...

Ways to verify if information is being added to a JSON file or not

JSON Here is the JSON structure where I am adding data with a button click event. var myData = { "info" : [] }; JavaScript Function I have written this function to add data to the JSON object: myData.info.push({ "Name" :name, ...