Utilizing three.js to calculate the minimum and maximum Box3 dimensions with the local

Feeling a bit stuck at the moment. I have multiple Vectors (Vertices) that are components of larger objects and I'm creating two Box3's with them:

    obj1box = new THREE.Box3().setFromPoints(buffer1); //buffer 1 and 2 are arrays of vectors
    obj2box = new THREE.Box3().setFromPoints(buffer2); //vectors were part of a massive object

Using these Boxes, I want to calculate distances between them, but both boxes are in local space. When I use console.log(obj1box), the box's max and min parameters are in local space, but I require them in world space. How can I convert the boxes into world space?

Answer №1

Here is the solution that worked:

    updating obj2's matrix world
    applying obj2's matrix world to obj2box

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

Vue watchers capturing original value prior to any updates

When working with Vue.js, we can easily access the value after modification within watchers using the following syntax: watch: function(valueAfterModification){ // ...... } But what about getting the value before it's modified? PS: The official ...

What is the best way to turn my thumbnail into a clickable link while having the title positioned to the right?

Is there a way to create a thumbnail that acts as a link and position the title next to the thumbnail? I have experimented with using 'after' and modifying the HTML structure to align them horizontally. Any ideas on how I can achieve this layou ...

Transforming JavaScript to TypeScript in Angular: encountering error TS2683 stating that 'this' is implicitly of type 'any' due to lacking type annotation

While in the process of migrating my website to Angular, I encountered an error when attempting to compile the JS into TS for my navbar. After searching around, I found similar issues reported by other users, but their situations were not quite the same. ...

Ajax continues to repeatedly redirect to the PHP page

I currently have a Shopify store and I am looking to incorporate a form on the product page. However, I am facing an issue where when I try to submit the form using AJAX with an external link, it redirects to the external page instead of staying on the cur ...

Keeping the Bootstrap popover anchored to the content

I have a functional bootstrap popover that includes a time attribute. However, I am looking to enhance its functionality so that it remains open when the mouse is on the content and closes only when the mouse leaves the content. Here is the relevant code ...

Problem with jQuery ajax: Sending an array doesn't work

I am attempting to transmit an array of data via AJAX to save it to the database. This is how I construct the array: $( "#saveordering" ).button().click(function( event ) { event.preventDefault(); var data = document.getElementByI ...

Tips for transforming a JSON response into an array with JavaScript

I received a JSON response from an API: [ { "obj_Id": 66, "obj_Nombre": "mnu_mantenimiento_de_unidades", "obj_Descripcion": "Menu de acceso a Mantenimiento de Unidades" }, { "obj_Id": 67, "ob ...

How to transfer data from JavaScript to PHP using AJAX

After spending countless hours attempting to make this function properly, I have come to you for assistance :) I have created a PHP page that can exhibit files from a server. I am able to modify the files using an editor plugin, where the Textarea tag is ...

Electron and React: Alert - Exceeded MaxListenersWarning: Potential memory leak detected in EventEmitter. [EventEmitter] has 21 updateDeviceList listeners added to it

I've been tirelessly searching to understand the root cause of this issue, and I believe I'm getting closer to unraveling the mystery. My method involves using USB detection to track the connection of USB devices: usbDetect.on('add', () ...

Sub properties are being systematically removed from the data as it travels from the Node/Express server to the React client

An unforeseen issue is occurring during data transmission from the server to the client, causing the loss of data from sub-properties before any action can be taken on it. This issue cannot be replicated elsewhere, as data querying and retrieval functions ...

What is the technique for retrieving the data-id value and transferring it to a different page with jQuery's post method?

Here is the code I'm working on: <a href="#view_contact" class="btn btn-info btn-xs view" data-id="<=$row['ADMINISTRATOR_ID'];?>" data-toggle="modal">View</a> I'm trying to fetch the value of data-id and pass it to a ...

Tips on updating time zone settings in a browser using React JS or JavaScript

I am currently facing a requirement where I need to adjust the application's time based on an environment variable. The entire application should operate using the timezone specified in the configuration file. For instance, if the designated timezone ...

A guide on implementing AJAX redirection in MVC

I currently have a button that, when clicked, takes input values and redirects to another page in JavaScript using the following code window.location = "Action Param1=value1&Param2=Value2". However, I am looking to avoid using query strings for this me ...

Creating a promise instance with the axios create method

As someone who is new to TypeScript, I am learning as I go along. One thing I want to do is create an axios instance that can be reused in my code by passing props only where needed. The framework I'm using is React. // Located in a utils folder // a ...

Error: The function 'myAppController' is not defined and is therefore not a valid argument

I am trying to incorporate my service into my controller and print a message to the console (in the Auth Service), but I keep encountering this error: Argument 'myAppController' is not a function, got undefined. Can you help me figure out what I& ...

Can the elevation of a particular polygon in Mapbox be adjusted downwards?

I have a 3D model of a house with a basement that I would like to upload to Mapbox. However, since the basement is underground, it is not visible in the model. Is there a way to adjust the terrain or z-axis of a specific area of the map, perhaps using a po ...

Enclose elements in a div using a jQuery each function

I have successfully parsed data from an XML feed to JSON, but now I want to wrap each part of the data within a div. Here is the code snippet I am working with: var newsDiv = $('<div class="news-feed">').appendTo($("body")); $(release ...

Is AJAX causing issues with my media uploader and color picker?

Currently, I have incorporated tabbed navigation within a WordPress admin page and it is functioning properly on its own (data can be saved). However, I am now looking to implement some AJAX functionality for toggling between pages. The issue arises when t ...

Using XSL variables in JavaScript code

I've noticed that there have been similar questions asked, but none of the solutions seem to help in my case. So, I have this variable named 'var': <xsl:variable name="var"> val </xsl:variable> Now, I want to use it like thi ...

To extract three records from storage and store them in the dbResult using a promise join technique

How can I efficiently retrieve and store 3 records in dbResult using promise join? Currently, I have code that retrieves a single record as shown below: req.oracleMobile.storage.getById(registry.getIncidentPhotoStorageName(), incident_id + '_01&apos ...