Incorrect orientation of JSON models in THREE.js

I've been working on a website that incorporates 3D graphics using THREE.js in JavaScript. However, I'm encountering an issue when trying to import a scene where all the objects are facing towards the inside of the planet. You can view the problem scene here.

Below is the code snippet I have been using to import the scene:

//ADDING GEOMETRY
var objects = [];
var loader = new THREE.ObjectLoader();

loader.load('models/planeta-NoMerge.json', function( obj ){
    scene.add( obj );

    scene.traverse(function( children ){
        objects.push(children);
    });

});

I am currently implementing raycasting as I need to display a different scene when the user clicks on a model.

If you require any additional information or assistance, please don't hesitate to let me know! :)

Answer №1

The issue lies not in the code that you provided. I have encountered similar problems before, but was able to resolve them by adjusting the export settings. These settings allow you to manipulate various aspects such as flipping normals, including or excluding materials, bones, animations, and more.

It's difficult to pinpoint the exact settings you require, as it ultimately depends on your specific needs. However, experimenting with different configurations will help you make progress.

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

How to prevent multiple instances of setTimeout executing

I am facing a particular issue with my music application development using JavaScript and other technologies. I have analyzed the module architecture in Engine and UI, and the problem seems to be within the Engine Modules. Specifically, I have a main Engin ...

Retrieving all items from a "group" in PHP using a JSON array

I am facing a challenge in PHP where I need to extract all objects from a JSON array that appear under ["Elements"]. However, the catch is that I do not know the "name" of the object or its content. My goal is to retrieve the value of the first object ins ...

IE9 is causing a bizarre problem where the entire page is suddenly jumping. It's

UPDATE: The client has requested testing to disable the click and drag feature in IE, so replicating the bug may be difficult at this time. I apologize if this hinders the community's ability to help fix the root issue. Here's the issue: It occu ...

Guide to Using Templates to Publish an API in WSO2 API Manager

Recently, I have been exploring the capabilities of wso2 API Manager 1.8.0 to convert a back end (http/post) system into a REST API. After successfully getting it up and running, I found myself having to manually tweak the API configuration through the Ser ...

Animating SVG elements with the rotation property in SVG.js

Currently, I am utilizing Javascript, Jquery, SVG, and SVG.js in my project. My goal is to rotate a circle around its origin while it's animating. The issue arises when the animation keeps restarting abruptly, causing a jittery motion. Here is the ini ...

react validation for dropdown, react-datepicker, and hour input at intermittent intervals

I have integrated the following packages into my project :- react-datepicker library for selecting from time and to time date validation with date-fns, moment.js, additional validations using jQuery and lodash libraries/packages If you want to view my pr ...

Experiencing difficulties with implementing jQuery validate for form submission, specifically when utilizing ajax within the submitHandler() function

I have a form that I am validating with jQuery validate plugin and want to submit it using ajax. However, when I place the ajax call inside the submitHandler() function of the validation method, the browser hangs. Can anyone help me figure out what's ...

Mailchimp fails to deliver response with a Status code of 404

I attempted to use the mailchimp API to set up a mailing list for my newsletter, but I keep getting a 404 error in response. I have double-checked everything multiple times, and it still shows the 404 error. Perhaps the endpoint is incorrect, even though ...

What is the most effective way to share data among components in React?

I recently delved into learning about react and find myself puzzled on how to pass data between two components. Presently, I have set up 2 functions in the following manner: First, there's topbar.tsx which displays information for the top bar, inclu ...

Dealing with data label overlap in smaller datasets when using the chartjs-plugin-datalabels in Chart.js

I have encountered an issue with the chartjs-plugin-datalabels where the values overlap when displaying a smaller dataset in large charts https://i.sstatic.net/0XIPZ.png Below is the configuration for the chartjs-data-plugin: options: { plugins: ...

pg-promise received an error due to an incorrect parameter being passed in for options

I have been working on transitioning my files from utilizing the pg package to the pg-promise package. Initially, everything was functioning correctly with the original pg solution I had in place. However, upon switching to pg-promise and referencing the d ...

Transform JavaScript XML DOM Object into an Object with a specific structure

After parsing a large XML DOM Object using jQuery's $.parseXML function, I have a JavaScript DOM Object. My goal is to create a regular JavaScript Object with a specific structure: { name: 'my_tree', children: [ { name: &apo ...

Unable to insert a JSON object into an array using JavaScript and MongoDB

I'm encountering an issue when trying to push data into my Student model with the following schema: var StudentSchema = new Schema({ firstName: { type: String, trim: true, default: '' //validate: [validat ...

Iterating through the startPrivateConversation method in Botkit for a multitude of users

In order to send an update to all my users, I created a new bot controller in a separate js file. To achieve this successfully, I needed to implement a notification function inside the controller's rtm_open function. The goal was to iterate through th ...

Using jQuery to retrieve the value of a specific column in a table upon clicking a

I am working on implementing a functionality in my html table where users can click on a row and see an alert pop up with specific column information. Currently, I have managed to make the alert show the data from the first column of the selected row but I ...

Exploring the World of Three.js: Modifying Facial Structures

Can anyone help me figure out how to obtain the average x, y, z coordinates of a specific face in three.js? Or, could someone guide me on extracting the individual x, y, z coordinates of the three vertices that compose a face and averaging them? Currently ...

Placing a hyperlink following the deletion of the last child element

In my scenario, I am trying to add a link to the last child of a specific class (('.' + change_class + ':last .adda .mediumCell:first')) after removing it. However, if the last child (44444444444444444444) is removed, the link is not ap ...

The connection with NSURL freezes

I'm currently facing a challenge with sending JSON post using NSURLConnection: NSURL *url = [NSURL URLWithString:urlStr]; NSString *jsonPostBody = [NSString stringWithFormat:@"{\"user\":""\"%@\""",\"pass\":""\"%@&b ...

javascript - audio is not working on the web

I've been trying to incorporate sound into my website using this code. Strangely, the sounds only seem to play in Adobe Dreamweaver and not in any browsers. Any advice would be greatly appreciated! :) var audio1 = new Audio('sound1.mp3'); v ...

Load additional slides in bxslider, monitor when it has reached the last one

I am using a horizontal carousel slider with bxslider, and I have disabled the infiniteLoop feature to prevent the slider from looping. My goal is to fetch additional slides via an AJAX request and add them to the slider once it reaches the end of the cu ...