The screen object is unable to perform the 'updateMatrixWorld' method. An error has occurred

I have been attempting to generate a sun, but every time I test run this code, I encounter an error:

THREE.CanvasRenderer 54 three.min.js:262
102
Uncaught TypeError: Object #<Screen> has no method 'updateMatrixWorld' three.min.js:126
192
Uncaught TypeError: Object #<Screen> has no method 'updateMatrixWorld'

Even though I am using the latest build that I downloaded yesterday (12th Jan 2013).

I would appreciate some guidance on what mistake I might be making!

In addition, I am curious about the distinction between WebGLRenderer and CanvasRenderer.

<script src="vendor/three.js/three.min.js"></script>
<script src="vendor/three.js/Detector.js"></script>
<script src="vendor/three.js/ShaderExtras.js"></script>
<script src="vendor/three.js/Stats.js"></script>
<script>
    var scene, renderer, camera, container, W, H;

    W = parseInt(document.body.clientWidth);
    H = parseInt(document.body.clientHeight);

    container = document.createElement('div');
    document.body.appendChild(container);

    camera = new THREE.PerspectiveCamera(45, W / H, 1, 10000); //field of view, aspect ratio, near and far clipping plane
    camera.position.z = 4300;
    scene = new THREE.Scene();

    //Sun
    var sun, sun_geom, sun_mat;
    sun_geom = new THREE.SphereGeometry(430, 30, 30); //radius, second and third parameters determine number of triangles to generate
    sun_mat = new THREE.MeshNormalMaterial();
    sun = new THREE.Mesh(sun_geom, sun_mat);
    scene.add(sun);

    //renderer
    renderer = new THREE.CanvasRenderer();
    renderer.setSize(W, H);
    container.appendChild(renderer.domElement);

    animate();

    function animate() {
        requestAnimationFrame(animate);

        renderer.render(screen, camera);
    }

</script>

Answer №1

While working in the animate function

I have corrected the line renderer.render(scene,camera);

Please forgive me for asking such a silly question, it was just a simple mistake :)

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

Utilizing numerous Nuxt vuetify textfield components as properties

Trying to create a dynamic form component that can utilize different v-models for requesting data. Component: <v-form> <v-container> <v-row> <v-col cols="12" md="4"> <v ...

Keep an ear out for updates on object changes in Angular

One of my challenges involves a form that directly updates an object in the following manner: component.html <input type="text" [(ngModel)]="user.name" /> <input type="text" [(ngModel)]="user.surname" /> <input type="text" [(ngModel)]="use ...

Tips for configuring <link> in NextJs to only activate on a single click

I am currently utilizing the Flickity-React-Component to create a swappable Carousel and I have included NextJs <Link> in its children. However, the issue arises when I click and swap the carousel - after releasing the mouse click, it automatically ...

Passing events between sibling components in Angular 2Incorporating event emission in

Having some trouble emitting an event from one component to another sibling component. I've attempted using @Output, but it seems to only emit the event to the parent component. Any suggestions? ...

Error message: 'firebase/app' does not export 'app' (imported as 'firebase') - Import attempt failed

Encountered a strange issue today. As I tried to import firebase, an error popped up: ./node_modules/firebaseui/dist/esm.js Attempted import error: 'app' is not exported from 'firebase/app' (imported as 'firebase'). The setup ...

What is the best method of transferring all procedures from frida javascript rpc.exports to python?

I have a JavaScript file containing rpc.exports rpc.exports = { callfunctionsecret: callSecretFun, callfunctionsomethingelse: callSomethingElse, } I am trying to retrieve a list of all these functions in Python, but I have been unable to find a so ...

Changing the color of a marker on hover in Mapbox using leaflet.js

I have encountered an issue where setting the geojson triggers the mouseover event, causing an infinite loop and breaking functionality. I managed to fix it by changing it to click, but now I need to figure out how to make it work with hover. My goal is t ...

What's the best way to align divs vertically in a compact layout?

Update The reason I require this specific behavior is to ensure that all my content remains in chronological order, both on the web page and in the HTML structure. This way, even if the layout collapses into a single column on smaller screens, the content ...

unable to locate public folder in express.js

I recently created a basic server using Node.js with Express, and configured the public folder to serve static files. Within my main index.js file, I included the following code: const express = require('express'); const app = express(); const h ...

jQuery .attr malfunctioning, retrieving incorrect links

I'm currently in the process of working on this page for a project $(function() { $(".modal-launcher, #modal-background").click(function() { $(".modal-content, #modal-background").toggleClass("active"); $(".vid-1i").attr("src", "l ...

Tips for smoothly applying a class to an image for seamless transitions, avoiding any awkward clunkiness

Check out my work on jsfiddle I understand that the image may not be visible, but I'll do my best to describe it. The header smoothly animates as I scroll down, but the image abruptly changes size instead of smoothly resizing. I want it to gradually ...

Guide on creating several TypeScript interfaces that share identical type structures

export interface UserFailureResponse { statusCode: number statusMessage: string } export interface UserCreateResponse { statusCode: number statusMessage: string } export interface AuthCheckResponse { statusCode: number statusMessa ...

Encountered an issue: Failed to load the scene.gltf file in the ./desktop_pc/ directory due to a problem with the loading of the "scene.bin" buffer using THREE.GLTFLoader. Currently troubleshooting this issue

I've attempted to use the (glb) format based on advice from another forum post, but it didn't resolve the issue. I've also tried other fixes with no success. Every time I try to render this scene, my browser (specifically internet download m ...

Issue with Angular ng-repeat not updating after array push

Struggling to grasp Angular concepts such as scopes has been a challenge for me. Recently, I encountered an issue where ng-repeat was not updating after adding a new 'wire' to my array. I suspected it could be due to the array being out of scope ...

endless refreshing material ui accordion

Facing an issue with infinite rerender while trying to create a controlled accordion component using Material UI accordion. Here is the code snippet, any insights on why this could be causing an infinite rerender? const [expanded, setExpanded] = React.us ...

Retrieve data from a single PHP page and display it on another page

In my project, I am working with three PHP pages: index.php, fetch_data.php, and product_detail.php. The layout of my index.php consists of three columns: filter options, products panel, and detailed description. Whenever a user clicks on a product in th ...

I am looking to transfer an image stored in a database onto a card

One issue I am facing is that when trying to display an image from a database, uploaded by a user and showing on a card with additional information like name and price, an icon resembling a paper with green appears in the output. Here's my code snippe ...

A unique Javascript feature that switches the text on various buttons

As someone who is relatively new to Javascript and web development, I am currently working on a project that involves creating multiple text areas for users to input and save text. Each text area is accompanied by a button with a unique ID that functions a ...

The most efficient method for retrieving data in React

Recently, I started working on a React App integrated with Riot API to display users' recent games and more. As part of this project, I'm utilizing React and NextJS (fairly new to NextJS). However, I'm contemplating the most efficient way to ...

How can I include additional view folders for Jade files in my EXPRESS application?

So, I understand that by using app.set('views', path.join(__dirname, 'views')); in Express, the view variable is set to render all .jade files in the ./views folder. However, I'm wondering if there's a way to add additional p ...