"Insufficient rendering in three.js for all meshes to be displayed

Having an odd issue with 3d max 2013 obj to three.js 59 rev. In my 3d max scene, I originally have 5 cube objects. However, when I import them into the three.js scene, only 3 cubes are showing up. Also, their pivot point seems to be shared at the center of all objects.

var loader = new THREE.OBJMTLLoader();
loader.load('models/cubes.obj');
loader.addEventListener('load', function (event) {
    object = event.content;
    for(k in object.children){
        group.add(object.children[k]); // Console showed there were 5 objects
    }
});

scene.add(group); 

Any thoughts on what might be causing this?

If I were to:

group.add(object); // I will see my five cubes, or 
scene.add(object) // but then I can't access the children at all

It's quite a perplexing situation.

Answer №1

The primary concern at hand is:

    It seems that the use of THREE.OBJMTLLoader() should be replaced with OBJLoader.

Another challenge encountered relates to the pivot point within the obj format, as per various sources indicating a known inconsistency in its positioning. For instance:

In a scenario where three identical mesh cubes are positioned at different locations, the pivot point for each object does not align with its individual center but rather corresponds to the collective center of all objects combined.

Even after assigning each object to its own 3D container, this issue remains unresolved.

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

Issue with TableHead not functioning properly when sorting is requested

I'm currently facing an issue with my table that has clickable row headers for sorting functionality using the onRequestSort function. Unfortunately, it seems like this feature is not working as expected. I have implemented the sorting logic using rea ...

Issues arising from the v-for loop iterating through the products list

Apologies for any language errors in my English, as it is not my first language. If you would like to view my github page, you can find it here: https://github.com/CapitaineBarbarossa/test-carousel I am currently facing an issue with creating a dynamic car ...

Fabric.js Textbox does not automatically wrap long text in version 5.3.0

I am currently using fabric.js version 5.3.0. The Textbox object in fabric.js will wrap text when you add space between words, but it won't wrap when you add text without any spaces. Please take a look at the following fiddle: https://jsfiddle.net/N ...

What is the best way to restrict a React input field to have values within the minimum and maximum limits set by its

As a newcomer to React, I am working on restricting my input to values between -10 and 10. Currently, the input is set up to accept any value, and I am utilizing hooks like useState and useEffect to dynamically change and set the input value. My goal is ...

Creating immersive 3D sound experiences using Web Audio and Three.js

I have a panorama player with 3D sounds that I am trying to integrate into Three.js by following this tutorial: http://www.html5rocks.com/en/tutorials/webaudio/positional_audio/ The camera remains fixed, while the 3D sounds are positioned across the scene ...

The Jquery append function is limited to the initial ajax request, necessitating a page refresh in order to populate another div with the desired

When making an AJAX request to retrieve a JSON array, upon successful completion another AJAX request is triggered. The retrieved data is then populated into the div of a bootstrap modal using the jQuery append function. Everything functions as expected ...

How to toggle a boolean variable in AngularJS when transitioning between states

Just getting started with AngularJS and trying to figure out how to tackle this issue. I have set up the following route: name: "Tracker", url: "/tracker/:period", and I have 3 distinct states for which I've created 3 separate functions to facilit ...

Stop fraudulent repetitive ajax calls to PHP

With my website, I've implemented a comment section for blog posts where users can share their thoughts. By clicking a button, an AJAX request is sent to PHP in JSON format. Upon receiving the data, PHP processes and validates it before inserting it i ...

How to apply bold styling to text with DOM Events

I am currently in the process of learning JavaScript and decided to practice by creating a text editor. The goal is to type something, click a button to change it to upper or lower case, bold, or italicize. While I successfully implemented the uppercase an ...

Exploring how to successfully test the parsing of a string using JSON.parse in Jest

Currently, I am in the process of creating unit tests for an API. In a scenario where I implement the following code: const apiResponse:object = JSON.parse(body) expect(apiResponse).toHaveProperty('error') If the API does not return JSON data, ...

Tips for delaying the execution of the next function until after a Firebase storage image upload is complete

I'm currently working on a function that involves uploading multiple images to Firebase, storing the returned URLs in an object, and then uploading that object to my Cloud Firestore database. However, my understanding of async/await and promises is li ...

How can I extract echoed information from PHP after submitting form data through jQuery Ajax?

I am looking to transfer a file from an input form to a php script using ajax and handle the response echoed by my php script. Here is my HTML form: <form id="fileUploadForm" method="POST" enctype="multipart/form-data"> <input name="fileToU ...

What is the best way to combine two arrays using Mongoose?

Group 1 = [X, , , , ,X] Group 2 = [ , , ,O, , ] I am looking for a way to combine group 1 with group 2 in order to achieve the following arrangement: [X, , , O, ,X] without simply replacing Group 1 with Group 2.. Here is the code snippet I have so far: ...

Unable to assign an attribute to an HTML element without a value ('hidden')

In my quest to dynamically toggle the hidden attribute on certain HTML elements, I have come up with the following code snippet: <li><a href="#" onclick="SelectImage( 5 ); return false;">6</a></li> ... <a href="/image/5">< ...

Unable to retrieve the following element in a JavaScript array

I am a beginner in JavaScript and I am attempting to access the next element of an array using an onclick function but so far I have not been successful. var i, len; function quiz() { var quiz_questions = [ "who is the founder of Fa ...

Pattern for Regular Expression to extract working hours string

I am currently developing a python library designed to parse various types of working hours string inputs and output them in a standardized format. I have encountered a challenge with the following scenario: Specifically, my regular expression should be c ...

Using AngularJS to link ng-include in an ng-view HTML file

Currently, I am diving into AngularJs while also investigating the creation of a viral movie website for the new x-men film. The site in question is Trask Industries (http://www.trask-industries.com/#/innovation), where the navigation system seems to dynam ...

JSNI is failing to execute external function calls properly

I need help converting this JavaScript code into JSNI code. Required Scripts <script src="jquery-1.11.2.min.js"></script> <script src="jquery.typeahead.min.js"></script> <script src="autocompletetest/autocompletetest.nocache.js ...

Steps to update the active state in the "reducer" when clicking on elements outside of the "reducer" area

Working with react-redux has presented some challenges for me. I've created multiple reducers such as action, root reducer, active_step reducer, and list_step reducer. One aspect that I find intriguing is the ability to dynamically map and change the ...

Issues arise when attempting to compare two dates using an if statement in JavaScript and Node.js

Below is the code I am working with: var currentDate = new Date().toLocaleString(); console.log(currentDate); // output: 2018-01-15 16:39:00 var selectedDate = '2018-01-15 16:39:00'; // This date is from an HTML form input field console.log(sel ...