Error Found: The function .setFromEuler() in THREE.Quaternion now requires an Euler rotation as input instead of a Vector3, along with its corresponding order

In my ThreeJS/WebGL project, I have created a rotating planet displayed inside an iframe. While the functionality is working as intended, I am encountering a warning and an error:

Warning: THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. 

Error: Uncaught Error: THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.

Within the iframe, I have included the necessary assets:

<div id="webgl"></div> 
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.js"></script> 
<script type="text/javascript" src="https://cdn.rawgit.com/bubblin/The-Solar-System/master/jupiter/js/detector.js"> 
</script> 
<script type="text/javascript" src="https://cdn.rawgit.com/bubblin/The-Solar-System/master/jupiter/js/trackBallControls.js"> </script>
<script type="text/javascript" src="https://cdn.rawgit.com/bubblin/The-Solar-System/master/jupiter/js/xRingGeometry.js"> </script>

For interactivity, I have implemented trackBallControls.js to allow users to rotate the sphere based on input. Additionally, I have made modifications to the RingGeometry method to customize the appearance of the ring around the planet.

Below is the complete code example showcasing the simulation of Jupiter:

(function() {
  // Code for rendering Jupiter simulation
}());

While the simulation functions correctly (view output here), the warnings and errors persist and lead to eventual crashes on iPad/iPhone devices. As a newcomer to ThreeJS, I seek guidance on resolving these issues.

Answer №1

Addressing:

Alert: Your texture is not a power of two. Optimal performance is achieved with power of two textures. To resolve this warning, adjust the size of the sphere texture and rings texture to be powers of two using an image editor. Alternatively, set the <code>minFilter as mentioned in the warning:

  function createSphere(radius, segments) {
    var texture = THREE.ImageUtils.loadTexture('https://cdn.rawgit.com/marvindanig/Images/master/jupiter/jupitermap.jpg');
    texture.minFilter = THREE.NearestFilter;
    return new THREE.Mesh(new THREE.SphereGeometry(radius, segments, segments), new THREE.MeshPhongMaterial({
      map: texture,
      bumpScale: 0.05,
      specular: new THREE.Color('#190909')
    }));
  }

Regarding the second issue, I am unable to reproduce it on Chrome 42. However, it may be due to a script (not shown here) using Quaternion.setFromEuler incorrectly:

 quat.setFromEuler(new THREE.Vector3(pitch, yaw, roll));

The correct usage should be:

 quat.setFromEuler(new THREE.Euler(pitch, yaw, roll));

Search your code using CTRL + F to locate and correct the problematic script.

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 do I determine the appropriate image type to use?

I'm a beginner in the world of Node.js and I'm currently working on an application that stores image files. However, I am unsure about what type of data the images should be. const userSchema = new mongoose.Schema({ userImage: { type ...

Several middlewares using router.params()

Is it possible to include multiple middlewares as parameters in the function router.params() in Node-Express? I currently have the following setup: const checkAuth = (req, res, next) => {console.log("checking auth"); next()} const checkAuth = ...

What is the best way to reference an i18n entry within .json files?

I am in the process of creating a user interface using SAP UI5 and my goal is to make all text elements internationalized. Below is a snippet of my view in .xml format where I successfully retrieve text in different languages using placeholders enclosed i ...

How do I test Pinia by calling one method that in turn calls another method, and checking how many times it has been called

As I embark on my journey with Vue 3 and Pinia, a particular question has been lingering in my mind without a concrete answer thus far. Let's delve into the crux of the matter... Here's an example of the store I am working with: import { ref, co ...

Is it the right time to implement a JavaScript framework?

Is there a need for using JavaScript frameworks like Angular or React if you are not developing single-page websites or components that receive live updates? ...

Utilizing Node Js and Selenium webdriver, what is the process of dragging and dropping an element from its current position to a new position just below it?

After multiple attempts, I have come to realize that the following code is ineffective. driver.findElement(By.xpath(xpath)).then(function (element1) { driver.findElement(By.xpath(xpath)).then(function (element2) { ...

"When using `app.use(express.static`, it appears that the functionality is not working properly when the app is a sub

I attempted to implement something similar to this: var main = express(); main.use(express.static(path.resolve('./asset'))); main.route('someroute', someHandle); var app = express(); app.use(express.static(path.resolve('./asset&ap ...

Implement a loading spinner to display each time a computed method is invoked in a Vue.js

Whenever a checkbox is checked, my filtering method gets triggered. I am trying to implement a loader that displays while the filter process is ongoing and then shows the results. However, I have encountered an issue where the loader remains visible at all ...

The proper way to cancel useEffect's Async in TypeScript

I'm facing an issue with this straightforward example: useEffect(() => { axios.get(...).then(...).catch(...) }, [props.foo]) warning: can't perform a react state update on an unmounted component After some investigation, I found this ...

Accessing attribute value of selected option in AngularJS select element

I have a select tag that displays options, and I want it so that when an option is selected, the value of the data-something attribute is copied into the input element. This is just for demonstration purposes; the actual value should be sent in the form. ...

Saving the id in a variable after triggering an AJAX request by clicking

I attempted to utilize an onClick event within the <a> element but it is not functioning as expected. I am aiming to capture the value 777 into a variable so that I can access it later in the code. My intention was to click on the image and have an ...

Google Maps Info Window with Asynchronous Loading

Need help with loading a Google map asynchronously on your website? Check out the code snippet below: function initialize(lat,lng) { var mapProp = { center: new google.maps.LatLng(lat,lng), zoom:15, mapTypeId: google.maps.MapTypeId.R ...

How can you determine the status of an individual checkbox within a reactjs (material-table) component?

In my project, I have implemented a table that displays a list of students retrieved from a database. Upon clicking on each student row, a modal popup appears showing another table with 4 rows and 3 columns. Each column in the modal contains 4 checkboxes. ...

Activate the jQuery click event by specifying the URL

On my webpage, I have a jQuery click function that loads multiple HTML pages into a specified div. I am looking to set specific URLs that will trigger this event, like test.com#about <script type="text/javascript"> $(document). ...

Combining objects using mathematical operations for identical properties in JavaScript

Imagine I have two sets of data: const obj1 = { CRITICAL: 0, ERROR: 1, INFO: 0, WARNING: 0, }; const obj2 = { CRITICAL: 0, ERROR: 0, INFO: 0, WARNING: 1, }; I'm looking to merge them into a single object with the summed values for e ...

experiencing an excessive amount of rerenders when trying to utilize the

When I call the contacts function from the main return, everything seems fine. However, I encounter an error at this point: const showContacts = React.useCallback( (data: UsersQueryHookResult) => { if (data) { return ( < ...

Tips on saving a cookie using universal-cookie

I followed a solution on Stack Overflow to set a cookie in my React application. However, the cookie expires with the session. Is there a way I can make this cookie persist beyond the session so it remains even when the browser is closed and reopened? ex ...

The program failed to run properly because it couldn't find the reference to Chart

I added chart.js to my project using npm with the command: npm install chart.js --save-dev. In the file "resources/assets/js/bootstrap.js", I included it by using: require('chart.js');. After running npm run dev in the console, it compiled succe ...

"Implementing Notifications in Mongoose: A Step-by-Step Guide

My current user schema is set up as follows: const Schema = mongoose.Schema; const bcrypt = require("bcryptjs"); const userSchema = new Schema( { email: { type: String, required: true, index: { unique: true } }, ...

A guide to deactivating the Material UI Link API element

Previously, I relied on Material UI's Button component with a disable property that allowed the button to be disabled based on a boolean value. However, I now want to use the Material UI Link component, which resembles a text link but functions like a ...