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 8037193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:51:20+00:00 2026-06-05T02:51:20+00:00

I know that in three.js we can load images directly from the server with

  • 0

I know that in three.js we can load images directly from the server with ImageUtils and models as .js files with the JSONLoader, but is it possible to load images and models from byte arrays directly? (for example, download a compressed file, extract it in javascript and feed the byte array directly into the loaders?)

thanks

  • 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-05T02:51:22+00:00Added an answer on June 5, 2026 at 2:51 am

    All right, I found the answers.

    It can be done by adding our own extension methods to the concerned objects. For the texture loading we can load a binary array by adding a new method to imageutils like this:

    THREE.ImageUtils.prototype.loadTextureBinary = function ( data, mapping, callback ) {
    
        var image = new Image(), texture = new THREE.Texture( image, mapping );
    
        image.onload = function () { texture.needsUpdate = true; if ( callback ) callback( this ); };
        image.crossOrigin = this.crossOrigin;
        image.src = "data:image/png;base64," + Base64.encode(data);
    
        return texture;
    };
    

    For loading string JSON, extract your data and make it into a string and pass it to this new extension method of JSONLoader:

    THREE.JSONLoader.prototype.loadJson = function ( data, callback, texturePath ) {
    
        var worker, scope = this;
    
        texturePath = texturePath ? texturePath : this.extractUrlBase( url );
    
        this.onLoadStart();
        var json = JSON.parse( data );
        context.createModel( json, callback, texturePath );
    };
    

    Note: the above code is for Three.js r49. If a newer version has code changes, add them to the above methods to comply.

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

Sidebar

Related Questions

I know that there can be multiple values for an email, but I'm not
I know that richtextboxes can detect links (like http://www.yahoo.com ) but is there a
I know that wordpress can be exported in the form of XML, but there
I know the term Load Balancing can be very broad, but the subject I'm
I wanted to know that is there any script or tool available which can
I would like to know what packages are out there that can be used
There are two ways that I know that you can fetch results in Rails
Assuming that I know there is a git-daemon running at git://git.mycompany.com , how can
How can I know during runtime that my code threw a Warning? example try
Now that I know I can no longer communicate with Twitter mashups out there,

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.