The three.js render of the collada model appears slightly off

The collada model appears distorted when rendered in three.js. Here is a screenshot:

The code used to load the model is quite simple:

loader.load( 'models/police_car.dae', function ( collada ) {
  dae = collada.scene;

  init();
});

The model was downloaded from Google SketchUp Warehouse. [link]

As a beginner with three.js, I am uncertain about the issue. Should I invoke a specific function to resolve it?

Any help would be greatly appreciated.

Answer №1

It seems that the issue lies in the rendering of back faces, which COLLADA doesn't have a clear way to specify as double-sided or not. Google Earth addresses this by exporting information using the following method:

<extra>
  <technique profile="GOOGLEEARTH">
    <double_sided>1</double_sided>
  </technique>
</extra>

In Three.js, the doubleSided attribute is used on objects to indicate whether a face is double sided. However, the ColladaLoader.js does not currently recognize the <extra> tag to set this property. A bug should be filed with the Three.js team to add support for this feature.

UPDATE: It appears that this issue has been resolved in the development branch. Loading the model now displays the dashboard of the car visible through the partially-transparent window.

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

Rotating 3D objects in React using Three.js

I have been working on a project where I created a 3D object that should rotate according to my code. However, it is not rotating as expected. Can someone please help me find the error in this code? Here is the code snippet: import React , {Suspense,useEf ...

What is the method to extract the Element Id from XML parsing in Google Apps Script?

Sample Xml Code <directory> <fieldset> <field id="displayName">Display name</field> </fieldset> <employees> <employee id="123"> <field id="displayName">John Doe</ ...

Angular displaying undefined for service

I have created a service for uploading images to a server, and I am encountering an issue when calling this service from my controller. The error message indicates that the function 'uploadFileToUrl' is undefined. Below is the code for my servic ...

Canvas drawImage function not displaying image at specified dimensions

I'm having trouble loading an image into a canvas using the drawImage function. Additionally, I've implemented drag functionality but found that when moving the image inside the canvas, it doesn't follow the mouse cursor in a linear manner. ...

Issues encountered with Reloading Express App on Angular Frontend

I am currently working on an Express App with an AngularJS Frontend and I have encountered a frustrating bug in my code that I cannot seem to solve. Every time I attempt to reload any section of my webpage, I receive the error message (Cannot GET /View1). ...

"Angular: Enhancing Functionality with Nested Controllers and Service Dependency Handling

Hey there! I've got a setup with nested angular controllers. The outer one is called personController, while the inner one is personScheduleController. In this arrangement, the person controller reaches out to a service to retrieve person data. On the ...

Struggling to transfer information from JavaScript to Python Flask?

I am currently working on a basic configuration where I need to send a string to my Flask application through Ajax, but unfortunately, I am encountering Error code 400: Bad request. Here is the JavaScript code snippet: headers = { 'Content-type&a ...

Utilizing the SFTP handler within the SSH2 library

As I work with SSH2 to interact with a server through SFTP, I find myself confused by the documentation. The part that perplexes me is related to understanding and utilizing the sftp object which is obtained by calling conn.sftp(function(err, sftp). Unfort ...

Unable to access object key data from JSON-SERVER

I am currently attempting to send a GET request to json-server in order to retrieve data from a nested object. However, the response I am receiving is empty instead of containing the desired data key. After thoroughly reviewing the documentation, I could ...

Is there a way to link the IDs in the data with Vue.js to access the corresponding names?

In the project I'm currently working on, I have two endpoints that provide different information. The 'categories' endpoint supplies me with category names and their corresponding id values, while the 'products' endpoint only gives ...

Utilize Discord.js to send a message and patiently await your response

I am facing an issue while trying to code a Discord bot. I'm struggling to make it wait until the user inputs 'Y' or 'N'. Specifically, I am currently working on the ban command and everything seems to be functioning well until the ...

Tips for choosing a single row in a table using a checkbox

I need help with a table that has multiple rows and four columns. One column is for checkboxes, while the other three are select boxes set to read-only. I want users to be able to edit only one row at a time by checking the checkbox in the first column. If ...

Adjust Div Width using a button press

I am attempting to create a functionality where an iFrame will resize in width upon clicking a button. My goal is to have multiple buttons representing breakpoints such as 1024, 680, 480, 380 pixels where the iFrame will adjust its size accordingly. Unfort ...

Is it possible to retrieve data from Local Storage using user_id and SessionId, and if so, how can it be done?

I have some data in an interactive menu created with iSpring, which includes a feature for local storage to save the last viewed page. I also have a system for logging and need to associate this local storage with user_id or sessionid. I found some informa ...

Making a Jquery Ajax Request in Real Time

Is there a way to make sure that the "Test Data" text is only displayed in the console after the book details are fully loaded into vm.books? I am trying to make a synchronous ajax call for this purpose. The code below is not producing the expected result ...

Executing a function when a dropdown in Bootstrap is expanded and closed

How can I use JavaScript to execute a function when clicking on a notification button in a Bootstrap navbar to expand the dropdown, and then close the dropdown when clicking it again? I have tried selecting the dropdown and modifying the click function, b ...

What is the process for including a task in the current method?

I've been working on building a web app similar to Google Calendar. I have successfully created the necessary objects and methods, but now I need to implement a feature that allows users to add tasks. My current idea is for users to input a task which ...

When switching out of VR mode on mobile, the Aframe resolution decreases

Upon transitioning from VR mode back to standard mode, the resolution of aframe scenes undergoes a significant drop from full HD to approximately 360p. It is unclear whether this issue stems from AFrame, Three.js, or a more general WebVR problem. Interest ...

Troubleshooting the onSubmit function issue within a react-bootstrap navigation dropdown

I've hit a roadblock trying to troubleshoot this issue with my first react project. The goal is to integrate a search input within a navigation dropdown using react-bootstrap. I believe I'm making progress as it works fine when the form is outsid ...

Is there a way to assign a specific color to individual users in a chat?

I have successfully implemented a chat feature using Pusher, but now I want to customize the appearance by changing the color of the username for the logged-in user when they are active in the conversation. Currently, both my username and another user&apos ...