Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7804715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:00:37+00:00 2026-06-02T02:00:37+00:00

There are some threads about textures which do not showing up. I have tried

  • 0

There are some threads about textures which do not showing up. I have tried them all, but nothing helped.

I have spent a few hours on this now. Every time I end up looking at a black sphere.

I am working on Chrome v18 and Windows 7. I also tried Firefox, but this browser does not really support Three.js.

This is the body of the script:

<body>

    <script src="../build/Three.js"></script>

    <script src="js/Stats.js"></script>
    <script src="../build/jquery-1.7.2.min.js"></script>

This is the script itself:

// stap1) camera, set the scene size
    var WIDTH = 400,
        HEIGHT = 300;

    // set some camera attributes
    var VIEW_ANGLE = 45,
        ASPECT = WIDTH / HEIGHT,
        NEAR = 0.1,
        FAR = 10000;

    var camera = new THREE.PerspectiveCamera(  
                VIEW_ANGLE,
          ASPECT,
          NEAR,
          FAR  );
// stap2) scene:                
    var scene = new THREE.Scene();
    // the camera starts at 0,0,0 so pull it back
   scene.add(camera);
     camera.position.z = +300;
    // get the DOM element to attach to
    // - assume we've got jQuery to hand
    var container = $('#container');

    // stap3)create a WebGL renderer:
    var renderer = new THREE.WebGLRenderer();
    // start the renderer
    renderer.setSize(WIDTH, HEIGHT);
    // attach the render-supplied DOM element
    container.append(renderer.domElement);

    // bol maken:
    // create the sphere's material
    // b.v: THREE.MeshBasicMaterial
    var sphereMaterial = new THREE.MeshLambertMaterial(
    {
        map: THREE.ImageUtils.loadTexture("http://dev.root.nl/tree/examples/textures/ash_uvgrid01.jpg")
    });

    // set up the sphere vars
    var radius = 50, segments = 16, rings = 16;
    var sphereGeometry = new THREE.SphereGeometry(radius, segments, rings); 
    // create a new mesh with sphere geometry -
    var sphere = new THREE.Mesh(
       sphereGeometry,
       sphereMaterial
         );

    sphere.position.x=0;
    var s=1;
    sphere.scale.set(s, s, s);  

    // add the sphere to the scene
    scene.add(sphere);
    // create a point light
    var pointLight = new THREE.PointLight( 0xFFFFFF );
    // set its position
    pointLight.position.x = 10;
    pointLight.position.y = 50;
    pointLight.position.z = 130;
    // add to the scene
    scene.add(pointLight);
    // draw!
    renderer.render(scene, camera);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:00:39+00:00Added an answer on June 2, 2026 at 2:00 am

    You need to wait until the image used as texture is fully downloaded.

    I have put your code on the web: http://jsfiddle.net/4Qg7K/ and just added a classic “render loop”:

    requestAnimationFrame(render);
    
    function render(){
      requestAnimationFrame(render);
    
      sphere.rotation.y += 0.005; //rotation stuff, just for fun
    
      renderer.render(scene, camera);
    };
    

    requestAnimationFrame function works like a timer, calling to the render function each time the browser is ready to update the web page.

    BTW, Three.js works fine with Firefox.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there are already some threads about this error, but none of them
I have some threads which talk about doing a svndadmin and a svnload, I
I know there are already some threads about this, but I just won't work
I have seen a couple threads about this, but am not getting very straight
There are several processes and some threads in one process. All processes need to
I know there are more threads about this but they dont help me and
Let's imagine I have two threads which execute some database-oriented code in thread-specific TransactionScopes
I have read some threads about how to imitate the iTunes source list style.
There are already some pretty good threads on this topic on Stack Overflow, but
Although there are some threads on here about .net charting controls, I'm starting new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.